Part Number Hot Search : 
1N4728 STU1955 SSCNE555 SD550YS SD550YS MC144111 PA1315NL 4AC26
Product Description
Full Text Search
 

To Download 71M6521BE-IGTF Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 1 of 97 general description the teridian 71m6521be is a highly integrated soc with an mpu core, flash and lcd driver. teridians patented single converter technol- ogy ? with a 22-bit delta-sigma adc, f our analog inputs, digital temperature compensation, precision voltage reference, battery voltage monitor, and 32- bit computation engine (ce) supports a wide range of residential metering applications with very few low-cost external components. a 32khz crystal time-base for the entire system furt her reduces system cost. the ic supports 2-wire single-phase residential metering along with tamper- detection mechanisms. maximum design flexibility is pr ovided by multiple uarts, i 2 c, wire, up to 14 dio pins and in-system programmable flash memory, which can be updated with data or applicat ion code in operation. a complete array of ice and developm ent tools, programming libraries and reference designs enable rapid devel opment and certific ation of amr and prepay meters that comply with worldwide electricity metering standards. mpu timers ia va ib xin xout vref rx/dio1 tx/dio2 v1 txrx com0..3 v3.3a v3.3sys vbat v2.5 vbias seg0..18 gnda gndd seg 24..31/ dio 4..11 seg 34..37/ dio 14..17 ice load 888888.88 i 2 c or wire eeprom power fault amr test pulse comparator sense drive/mod serial ports osc/pll converter dio, pulse compute engine flash ram voltage ref regulator power supply teridian 71m6521be 3.3v lcd temp sensor 32 khz a neut ct/shunt 11/14/2007 vb b load ir pwr mode control wake-up battery ice_e gndd v3p3d seg 32,33, 38 features ? < 0.4% wh accuracy over 2000:1 current range and over temperature ? exceeds iec62053 / ansi c12.20 standards ? voltage reference < 40ppm/c ? four sensor inputsvdd referenced ? low jitter wh test output (10khz maximum) ? pulse count for wh pulse output ? tamper detection: neutral current with ct or shunt ? line frequency count for time keeping ? digital temperature compensation ? sag detection for phase a and b ? independent 32-bit compute engine ? 46-64hz line frequency range with same calibration ? phase compensation ( 7 ) ? battery monitor ? three battery modes w/ wake-up on push-button or timer: brownout mode (48a) lcd mode (5.7a) sleep mode (2.9a) ? energy display on main power failure ? wake-up with push-button ? 22-bit delta-sigma adc ? 8-bit mpu (80515), 1 clock cycle per instruction w/ integrated ice for mpu debug ? hardware watchdog timer, power fail monitor ? lcd driver (up to 140 pixels) ? up to 14 general purpose i/o pins ? 32khz time base ? 8kb flash with security ? 2kb mpu xram ? two uarts for ir and amr ? digital i/o pins compatible with 5v inputs ? 64-pin lqfp ? lead free package downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 2 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 table of contents general description ............................................................................................................................................1 features ......................................................................................................................................................1 hardware description .........................................................................................................................................9 hardware overview ..........................................................................................................................................9 analog front end (afe) ...................................................................................................................................9 input multiplexer ............................................................................................................................... .9 a/d converter (adc) .......................................................................................................................10 fir filter ............................................................................................................................... ...........10 voltage references .........................................................................................................................10 temperature sensor ........................................................................................................................11 battery monitor ............................................................................................................................... .12 functional description .....................................................................................................................12 digital computation engine (ce) ...................................................................................................................12 meter equations ..............................................................................................................................1 3 real-time monitor ...........................................................................................................................13 pulse generator ..............................................................................................................................1 3 ce functional overview ..................................................................................................................14 80515 mpu core ............................................................................................................................... ............16 memory organization ......................................................................................................................16 special function registers (sfrs) ..................................................................................................18 special function registers (generic 80515 sfrs) .........................................................................19 special function registers specific to the 71m6521be ..................................................................21 instruction set ............................................................................................................................... ...22 uart ............................................................................................................................... ................22 timers and counters .......................................................................................................................25 wd timer (software watchdog timer) ............................................................................................27 interrupts ............................................................................................................................... ..........29 on-chip resources ............................................................................................................................... ........37 oscillator ............................................................................................................................... ...........37 pll and internal clocks ...................................................................................................................37 temperature sensor ........................................................................................................................37 physical memory .............................................................................................................................37 optical interface ..............................................................................................................................3 8 digital i/o ............................................................................................................................... ..........39 lcd drivers ............................................................................................................................... ......41 battery monitor ............................................................................................................................... .41 eeprom interface ..........................................................................................................................41 hardware watchdog timer ..............................................................................................................45 program security .............................................................................................................................45 downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 3 of 97 test ports ............................................................................................................................... .........46 functional description ............................................................................................................................... ......47 theory of operation ............................................................................................................................... ........47 system timing summary ............................................................................................................................... 48 battery modes ............................................................................................................................... .................49 brownout mode .........................................................................................................................50 lcd mode ............................................................................................................................... ........51 sleep mode ............................................................................................................................... ....51 fault and reset behavior ..............................................................................................................................5 6 wake up behavior ............................................................................................................................... ..........57 wake on pb ............................................................................................................................... ......57 wake on timer ............................................................................................................................... .57 data flow ............................................................................................................................... ........................58 ce/mpu communication ............................................................................................................................... 58 temperature measurement ...........................................................................................................................59 temperature compensation ..........................................................................................................................59 application information ............................................................................................................................... ....60 connection of sensors (ct, resistive shunt) ................................................................................................60 connecting 5v devices ............................................................................................................................... ...60 connecting lcds ............................................................................................................................... ............61 connecting i 2 c eeproms ............................................................................................................................63 connecting three-wire eeproms ................................................................................................................63 uart0 (tx/rx) ............................................................................................................................... ..............64 optical interface ............................................................................................................................... ..............64 connecting v1 and reset pins ......................................................................................................................65 connecting the emulator port pins ................................................................................................................66 crystal oscillator ............................................................................................................................... .............67 flash programming ............................................................................................................................... .........67 mpu firmware library ............................................................................................................................... ....67 meter calibration ............................................................................................................................... .............67 firmware interface ............................................................................................................................... .............68 i/o ram map C in numerical order ..............................................................................................................68 sfr map (sfrs specific to teridian 80515) C in numerical order ..........................................................69 i/o ram description C alphabetical order ..............................................................................................70 ce interface description ............................................................................................................................... .76 ce program ............................................................................................................................... ......76 formats ............................................................................................................................... ............76 constants ............................................................................................................................... .........76 environment ............................................................................................................................... .....76 ce calculations ............................................................................................................................... 77 ce status ............................................................................................................................... .....77 downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 4 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 ce transfer variables ..........................................................................................................79 other ce parameters ......................................................................................................................80 electrical specifications ............................................................................................................................... .83 absolute maximum ratings ................................................................................................................83 recommended external components ...........................................................................................84 recommended operating conditions ............................................................................................84 performance specifications ............................................................................................................85 input logic levels ...................................................................................................................85 output logic levels ...............................................................................................................85 power-fault comparator ....................................................................................................85 battery monitor ......................................................................................................................85 supply current ........................................................................................................................86 v3p3d switch ..............................................................................................................................8 6 2.5v voltage regulator ........................................................................................................86 low power voltage regulator .........................................................................................87 crystal oscillator ................................................................................................................87 vref, vbias ............................................................................................................................... ...87 adc converter, v3p3a referenced ...................................................................................88 optical interface ....................................................................................................................88 temperature sensor .............................................................................................................89 lsb values do not include the 9-bit left shift at ce input. ................................................................89 lcd drivers ............................................................................................................................... .88 timing specifications ...........................................................................................................................90 ram and flash memory ..........................................................................................................90 flash memory timing ..............................................................................................................90 eeprom interface ....................................................................................................................90 reset ............................................................................................................................... .............90 typical performance data ..................................................................................................91 package outline (lqfp 64) ...................................................................................................................92 pinout (lqfp-64) ............................................................................................................................... ........93 pin descriptions ............................................................................................................................... ......94 power/ground pins: .........................................................................................................................94 analog pins: ............................................................................................................................... .....94 digital pins: ............................................................................................................................... .......95 i/o equivalent circuits: ....................................................................................................................96 ordering information .........................................................................................................................97 downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 5 of 97 list of figures figure 1: ic functional block diagram ...........................................................................................................................8 figure 2: general topology of a chopped amplifier ....................................................................................................11 figure 3: afe block diagram ............................................................................................................................... ........12 figure 4: samples from multiplexer cycle ....................................................................................................................14 figure 5: accumulation interval ............................................................................................................................... .....15 figure 6: interrupt structure ............................................................................................................................... ..........36 figure 7: optical interface ............................................................................................................................... .............39 figure 8: connecting an external load to dio pins .....................................................................................................40 figure 9: 3-wire interface. write command, hiz=0. ....................................................................................................43 figure 10: 3-wire interface. write command, hiz=1 ...................................................................................................43 figure 11: 3-wire interface. read command. ..............................................................................................................44 figure 12: 3-wire interface. write command when cnt=0 .........................................................................................44 figure 13: 3-wire interface. write command when hiz=1 and wfr=1. ......................................................................44 figure 14: functions defined by v1. .............................................................................................................................45 figure 15: voltage. current, mo mentary and accumulated energy .............................................................................47 figure 16: timing relationship between adc mu x, compute engine, and serial transfers. .....................................48 figure 17: rtm output format ............................................................................................................................... .....49 figure 18: operation modes state diagram .................................................................................................................50 figure 19: functional blocks in browno ut mode (inactive blocks grayed out) ........................................................52 figure 20: functional blocks in lcd mode (inactive blocks grayed out) ......................................................................53 figure 21: functional blocks in sleep mode (inactive blocks grayed out) .................................................................54 figure 22: transition from brownout to mission mode when system power returns .........................................55 figure 23: power-up timing with v3p3sys and vbat tied together ..........................................................................55 figure 24: power-up timing with vbat only ...............................................................................................................56 figure 25: wake up timing ............................................................................................................................... ...........57 figure 26: mpu/ce data flow ............................................................................................................................... ......58 figure 27: mpu/ce communication ............................................................................................................................58 figure 28: resistive voltage divider (left), current transformer (right) .....................................................................60 figure 29: resistive shunt ............................................................................................................................... ............60 figure 30: connecting lcds ............................................................................................................................... .........61 figure 31: i 2 c eeprom connection ............................................................................................................................63 figure 32: three-wire eeprom connection ...............................................................................................................63 figure 33: connections for the rx pin .........................................................................................................................64 figure 34: connection for optical components ...........................................................................................................65 figure 35: voltage divider for v1 ............................................................................................................................... ..65 figure 36: external components for the reset pi n: push-button (left), emi circuit (right) .....................................66 figure 37: external components for the emulator interface ........................................................................................66 figure 38: wh accuracy, 0.1a to 200a at 240v/50hz and room temperature ...........................................................91 figure 39: meter accuracy over harmonics at 240v, 30a ............................................................................................91 figure 40: typical meter accuracy over temperature relative to 25c .......................................................................92 downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 6 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 list of tables table 1: inputs selected in regular and alternate multiplexer cycles ...........................................................................9 table 2: ce dram locations for adc results ............................................................................................................13 table 3: memory map .............................................................................................................................. ............16 table 4: stretch memory cycle width ..........................................................................................................................17 table 5: internal data memory map .............................................................................................................................18 table 6: special function registers locations ............................................................................................................18 table 7: special function registers reset values ......................................................................................................19 table 8: psw register flags ............................................................................................................................... ........20 table 9: psw bit functions ............................................................................................................................... ..........20 table 10: port registers .............................................................................................................................. ............21 table 11: special function registers ...........................................................................................................................22 table 12: baud rate generation ............................................................................................................................... ...23 table 13: uart modes .............................................................................................................................. ............23 table 14: the s0con register ............................................................................................................................... ....23 table 15: the s1con register ............................................................................................................................... ......23 table 16: the s0con bit functions ............................................................................................................................24 table 17: the s1con bit functions ............................................................................................................................24 table 18: the tcon register ............................................................................................................................... .......25 table 19: the tcon register bit functions ................................................................................................................25 table 20: the tmod register ............................................................................................................................... ......26 table 21: tmod register bit description ....................................................................................................................26 table 22: timers/counters mode description ..............................................................................................................26 table 23: timer modes .............................................................................................................................. ............27 table 24: the pcon register ............................................................................................................................... ......27 table 25: pcon register bit description .....................................................................................................................27 table 26: the ien0 register (see also table 32) ........................................................................................................28 table 27: the ien0 bit functions (see also table 32) .................................................................................................28 table 28: the ien1 register (see also tables 30/31) .................................................................................................28 table 29: the ien1 bit functions (see also tables 31/32) ..........................................................................................28 table 30: the ip0 register (see also table 45) ...........................................................................................................29 table 31: the ip0 bit functions (see also table 45) ....................................................................................................29 table 32: the wdtrel register ............................................................................................................................... ..29 table 33: the wdtrel bit functions .........................................................................................................................29 table 34: the ien0 register ............................................................................................................................... .........30 table 35: the ien0 bit functions ............................................................................................................................... .30 table 36: the ien1 register ............................................................................................................................... .........30 table 37: the ien1 bit functions ............................................................................................................................... .31 table 38: the ien2 register ............................................................................................................................... .........31 table 39: the ien2 bit functions ............................................................................................................................... .31 table 40: the tcon register ............................................................................................................................... .......31 table 41: the tcon bit functions ..............................................................................................................................3 1 table 42: the t2con bit functions ............................................................................................................................32 table 43: the ircon register ............................................................................................................................... .....32 table 44: the ircon bit functions .............................................................................................................................32 table 45: external mpu interrupts ............................................................................................................................... 33 downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 7 of 97 table 46: interrupt enable and flag bits .....................................................................................................................33 table 47: priority level groups ............................................................................................................................... .....34 table 48: the ip0 register 34 table 49: the ip1 register: ............................................................................................................................... ..........34 table 50: priority levels .............................................................................................................................. ............35 table 51: interrupt polling sequence ...........................................................................................................................35 table 52: interrupt vectors ............................................................................................................................... ...........35 table 53: data/direction registers and internal resources for dio pin groups .........................................................39 table 54: dio_dir control bit ............................................................................................................................... ......40 table 55: selectable controls using the dio_dir bits ................................................................................................41 table 56: eectrl status bits ............................................................................................................................... ......42 table 57: eectrl bits for 3-wire interface .................................................................................................................43 table 58: tmux [4:0] selections ............................................................................................................................... ....46 table 59: available circuit functions ( means not active) .....................................................................................51 table 60: lcd and dio pin assignment by lcd_num ...............................................................................................62 downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 8 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 ia va mux xin xout vref ckadc cktest/ seg19 ce 32 bit compute engine mpu (80515) ce control opt_rx/ dio1 opt_tx/ dio2/ wpulse/ varpulse reset vbias v1 emulator port ce_busy optical uart tx rx xfer busy com0..3 vlc2 lcd display driver data 00-7f prog 000-1ff data 0000-ffff prog 0000-1fff 0000- 1fff mpu xram (2kb) 0000-07ff digital i/o config (i/o ram) 2000-20ff i/o ram ce ram (0.5kb) memory share 1000-11ff 32khz mux_sync ckce ckmpu ck32 ce_e rtm_e comp_stat power fault lcd_e lcd_clk lcd_mode dio 4.9mhz <4.9mhz 4.9mhz gndd v3p3a v3p3d vbat volt reg 2.5v to logic v2p5 mpu_div sum_cycles pre_samps equ ckout_e 32khz tmuxout mpu_rstz faultz wake tmux[4:0] configuration parameters gnda vbias temp february 2, 2007 cross ck_gen osc (32khz) ck32 ckout_e mck pll vref vref_dis div adc mux ctrl mux_div chop_e equ strt ib mux mux ckfir 4.9mhz rtm seg34/dio14 .. seg37/dio17 wpulse varpulse wpulse varpulse test test mode lcd_mode vlc1 vlc0 lcd_e <4.9mhz lcd_num dio_r dio_dir lcd_num dio_pv/pw mux_alt seg24/dio4 .. seg31/dio11 sdck sdout sdin e_rxtx/seg38 e_tclk/seg33 e_rst/seg32 flash 8kb flsh66zt v3p3a fir_len fir seg0..18 eeprom interface dio_eex ck_2x eck_dis opt_txe v3p3d lcd_gen x4mhz pb vb vbias memory share seg32,33 seg19,38 e_rxtx e_tclk e_rst (open drain) ice_e dio1,2 vref_cal ? adc converter + - vref adc_e rtm_0..3 ce_lctn pls_maxwidth pls_interval pls_inv opt_txinv opt_txmod opt_fdc opt_rxinv opt_rxdis lcd_blkmap lcd_seg lcd_y sleep lcd_only v3p3sys test mux ce_lctn figure 1: ic functional block diagram downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 9 of 97 hardware description hardware overview the teridian 71m6521be single-chip energy meter integrates all primary functional blocks required to implement a solid- state electricity meter. included on ch ip are an analog front end (afe), an independent digital computation engine (ce), an 8051-compatible microprocessor (mpu) wh ich executes one instruction per clo ck cycle (80515), a voltage reference, a temperature sensor, lcd drivers, ram, flash memory, and a variety of i/o pins. va rious current sensor technologies are supported including current transforme rs (ct) and resistive shunts. in a typical application, the 32-bit co mpute engine (ce) of the 71m6521be sequentially processe s the samples from the voltage inputs on pins ia, va, ib, vb 1 and performs calculations to measure acti ve energy (wh). this measurement is then accessed by the mpu, processed fu rther and output using t he peripheral devices available to the mpu. measurements can be displayed on 3.3v lcd commonly used in low temperature environments. flexib le mapping of lcd display segments will facilitate integration of existing custom lcd. design trade-off between the number of lcd segments vs. dio pins can be implemented in software to accommodate various requirements. the on-chip digital temperature compens ation mechanism includes a temperatur e sensor and associated controls for correction of unwanted temperature effe cts on measurement. temper ature dependent external com ponents such as crystal oscillator, current sensors, and their co rresponding signal conditioning circuits can be characterized and their correction fac tors can be programmed to produce electricity meters with exceptional accuracy over the industrial te mperature range. one of the two internal uarts is adapted to support an infrared led with internal dr ive and sense configur ation, and can also function as a standard uart. the optical out put can be modulated at 38khz. this flex ibility makes it possible to implement amr meters with an ir interface. a bl ock diagram of the ic is shown in figure 1 . a detailed description of various functional blocks follows. analog front end (afe) the afe of the 71m6521be is comprised of an input multiplexer, a delta-sigma a/d converter and a voltage reference. input multiplexer the input multiplexer supports up to four input signals that are applied to pins ia, va, ib and vb 1 of the device. additionally, using the alternate multiplexer selection, it has the ability to sele ct temperature and the battery voltage. the multiplexer ca n be operated in two modes: ? during a normal multiplexer cycle, the signals fr om the ia, ib, va, and vb pins are selected. ? during the alternate (alt) multiplexer cycle, the temperature signal (temp) and the battery monitor are selected, along with the signal sources shown in table 1 . to prevent unnecessary drainage on the battery, the battery monitor is enabled only with the bme bit (0x2020[6]) in the i/o ram. the alternate multiplexer cycles are usually performed infrequently (e. g. every second or so) by the mpu. in order to prevent disruption of the voltage tracki ng pll and voltage allpass networks, va is not r eplaced in the alt multiplexer selections. missing samples due to an alt multiplexer sequence are filled in by the ce. regular mux sequence alt mux sequence mux state mux state equ 0 1 2 3 0 1 2 3 0 ia va ib vb temp va ib vbat table 1: inputs selected in regular and alternate multiplexer cycles 1 : vb is available, but not used in typical 1-phase, 2-wire meters downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 10 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 in a typical application, ia and ib are connected to current transformers that s ense the current on eac h phase of the line voltage. va is typically connected to a voltage sensor (resistor divider). the multiplexer control circuit handles the setting of the multiplexer. the function of the multiplexer control circuit is gove rned by the i/o ram registers mux_alt, mux_div and equ. mux_div controls the number of sample s per cycle. it can request 2, 3, or 4 multiplexer states per cycle. multiplexer states above 4 are reserv ed and must not be used. the multiplexer always starts at the beginning of its list and proceeds until mux_div states have been converted. the mux_alt bit requests an alternative multiplexer frame. the bit may be asserted on any mpu cycle and may be subsequently de-asserted on any cycle including the next one. a rising edge on mux_alt will cause the multiplexer control circuit to wait until the next multiplexer cy cle and implement a single alternate cycle. the multiplexer control circuit also cont rols the fir filter initia tion and the chopping of the adc reference voltage, vref. th e multiplexer control circuits clocked by ck32, the 32768hz clock from the pll bl ock, and launches each pass through the ce program. a/d converter (adc) a single delta-sigma a/d converter digitizes the voltage and cu rrent inputs to the 71m6521be. t he resolution of the adc is programmable using the fir_len register as shown in the i/o ram section. adc resolution can be selected to be 21 bits ( fir_len =0), or 22 bits ( fir_len =1). conversion time is two cycles of ck32 with fir_len = 0 and three cycles with fir_len = 1. in order to provide the maximum resolution, the adc should be operated with fir_len = 1. accuracy and timing specifications in this data sheet are based on fir_len = 1. initiation of each adc conversion is controlled by the multiplexer control circ uit as described previously. at the end of each adc conversion, the fir filter output data is stored into the ce dram locati on determined by the multiplexer selection. fir filter the finite impulse response filter is an in tegral part of the adc and it is optimized for use with the multiplexer. the purpose of the fir filter is to decimate the adc output to the desired reso lution. at the end of each adc conversion, the output data is stored into the fixed ce dram location dete rmined by the multiplexer selection. fir dat a is stored lsb justif ied, but shifted l eft by nine bits. voltage references the device includes an on-chip precision bandgap voltage reference that in corporates auto-zero techniques. the reference is trimmed to minimize errors caused by component mismatch and drift. the result is a vo ltage output with a predictable temperature coefficient. the amplifier within the reference is chopper stabilized, i.e. the polarity can be switched by the mpu using the i/o ram register chop_e (0x2002[5:4]). the two bits in the chop_e register enable the mpu to operat e the chopper circuit in regular or inverted operation, or in toggling mode. when the chopper circuit is toggled in between multiplexer cycles, dc offsets on the measured signals will aut omatically be averaged out. the general topology of a c hopped amplifier is given in figure 2 . downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 11 of 97 g - + v inp v outp v outn v inn cross ab ab a b a b figure 2: general topology of a chopped amplifier it is assumed that an offset voltage voff appears at the positive amplifier input. with all switches, as controlled by cross in the a position, t he output voltage is: voutp C voutn = g (vinp + voff C vinn) = g (vinp C vinn) + g voff with all switches set to the b position by applying the inverted cross si gnal, the output voltage is: voutn C voutp = g (vinn C vinp + voff) = g (vinn C vinp) + g voff, or voutp C voutn = g (vinp C vinn) - g voff thus, when cross is toggled, e.g. after eac h multiplexer cycle, the offset will al ternately appear on the output as positive an d negative, which results in the offset effectively being eliminated, regardl ess of its polarity or magnitude. when cross is high, the hookup of the amplifier input devices is reversed. this preserves the overall polar ity of that amplifier gain, it inverts its input offset. by alternately reversing the c onnection, the amplifiers offset is averaged to ze ro. this removes the most significant long-term drift mechanism in the voltage reference. the chop_e bits control the behavior of cross. the cross signal will reverse the amp lifier connection in the voltage reference in order to negate the effects of its offset. on the first ck32 rising edge after the last mux state of its sequence, the mux will wait one additional ck32 cycle before beginning a new frame. at the beginning of this cycle, the val ue of cross will be updated according to the chop_e bits. the extra ck32 cycle allows time for the chopped vref to settle. during this cycle, muxsync is held high. the leading edge of muxsync initiates a pass through the ce progr am sequence. the beginning of the sequence is the serial readout of the 4 rtm words. chop_e has 3 states: positive, revers e, and chop. in the positive state, cross is held low. in the reverse state, cross is held high. in the chop state, cross is toggled near the end of each mux frame, as described above. it is desirable that cross take on alternate values at the begi nning of each mux cycle. for this reason, if chop state is selected, cross will not toggle at the end of the last mux cycle in a sum cycle. the internal bias voltage vbias (typically 1.6v) is used by the adc when measur ing the temperature and battery monitor signals. temperature sensor the 71m6521be includes an on-chip temperat ure sensor implemented as a bandgap refer ence. it is used to determine the die temperature the mpu may request an alter nate multiplexer cycle containing the temperature sensor output by asserting mux_alt . the primary use of the temperat ure data is to determine the magni tude of compensation required to offset the thermal drift in the system (see section titled temperature compensation). downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 12 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 battery monitor the battery voltage is measured by the adc dur ing alternative multip lexer frames if the bme (battery measure enable) bit in the i/o ram is set. while bme is set, an on-chip 45k load resistor is applied to the battery, and a scaled fraction of the battery voltage is applied to the adc input. after each alternative mux frame, the result of the adc conversion is available at ce dram address 07. bme is ignored and assumed zero when system power is not available (v1 < vbias). see the battery monitor section of the electrical spec ifications for details r egarding the adc lsb size and the conversion accuracy. functional description the afe functions as a data acquisition sy stem, controlled by the mpu. the main signals (ia, va, ib, vb) are sampled and the adc counts obtained are stor ed in ce dram where they can be accessed by the ce and, if necessary, by the mpu. alternate multiplexer cycles are initia ted less frequently by the mpu to gather a ccess to the slow temperature and battery signals. ia va mux vref 4.9mhz vbias cross ck32 vref vref_dis mux ctrl mux_div chop_e equ ib mux mux_alt v3p3a fir_len fir vb vbias vref_cal ? adc converter + - vref adc_e temp vbat fir_done fir_start figure 3: afe block diagram digital computation engine (ce) the ce, a dedicated 32-bit signal processor, performs the precision computations necessary to accurately measure energy. the ce calculations and processes include: ? multiplication of each current sample with its associated voltage sample to obtain the energy per sample (when multiplied with the constant sample time). ? frequency-insensitive delay cancellation on all channels (t o compensate for the delay between samples caused by the multiplexing scheme). ? pulse generation. ? monitoring of the input signal frequenc y (for frequency and phase information). ? monitoring of the input signal amplitude (for sag detection). ? scaling of the processed sample s based on calibration coefficients. the ce program resides in flash memory. common access to fl ash memory by ce and mpu is controlled by a memory share circuit. each ce instruction word is two bytes long. allo cated flash space for the ce program cannot exceed 1024 words (2kb). the ce program counter begins a pass through the ce code each time multiplexer state 0 begins. the code pass ends when a halt instruction is executed. fo r proper operation, the code pass must be completed before the multiplexer cycle ends (see system timing summary in the functional description section). downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 13 of 97 the ce program must begin on a 1kbyte boundary of the flash address. the i/o ram register ce_lctn[4:0] defines which 1kb boundary contains the ce code. thus, the first ce instruction is located at 1024* ce_lctn[4:0] . the ce dram can be accessed by the fir f ilter block, the rtm circuit, the ce, and the mpu. assigned time slots are re- served for fir, rtm, and mpu, respectively, to prevent bus contention for ce dram data acce ss. holding registers are used to convert 8-bit wide mpu data to/from 32-bit wide ce dra m data, and wait states are inserted as needed, depending on the frequency of ckmpu. the ce dram is 128 32-bit words. the mpu can read and write the ce dram as the primary means of data communication between the two processors. table 2 shows the ce dram addresses alloca ted to analog inputs from the afe. address (hex) name description 00 ia phase a current 01 va phase a voltage 02 ib phase b current 03 vb (phase b voltage C not used) 04 - not used 05 - not used 06 temp temperature 07 vbat battery voltage table 2: ce dram locations for adc results the ce of the 71m6521be is aided by suppor t hardware that facilitat es implementation of equat ions, pulse counters, and accumulators. this support hardware is controlled through i/o ram locations equ (equation assist), dio_pv and dio_pw (pulse count assist), and pre_samps and sum_cycles (accumulation assist). pre_samps and sum_cycles support a dual level accumulation scheme where the first accumulator accumula tes results from pre_samps samples and the second accu- mulator accumulates up to sum_cycles of the first accumulator results. the integration time for each energy output is pre_samps * sum_cycles /2520.6 (with mux_div = 1). ce hardware issues t he xfer_busy interrupt when the accumulation is complete. meter equations compute engine (ce) firmware for residentia l meter configurations implements the calculations for equation 0 for a single- element, 2-wire, 1-phase meter with neutral current sense and ta mper detection. the energy fo r element 0 is determined by va*ia, and the energy for element 1 is determined by va*ib. real-time monitor the ce contains a real-time monitor (rtm), which can be programmed through the uart to monitor four selectable ce dram locations at full sample rate. the four monitored locations are serially output to the tm uxout pin via the digital output multiplexer at the beginning of each ce code pass. the rtm can be enabled and disabled with rtm_en . the rtm output is clocked by cktest. each rtm word is clocked out in 35 cycles and contains a leading flag bit. see the functional description section for the rtm output fo rmat. rtm is low when not in use. pulse generator the chip contains a pulse generator that creates low-jitter wh pulses at a rate set by the ce. the i/o ram bit dio_pw, as described in the digital i/o section, can be programmed to route wp ulse to the output pin dio6. pulses can also be output on opt_tx (see opt_txe[1:0] for details). the value of pls_interval depends on the sample rate (nominal 2520hz) and the number of times t he pulse generator is executed in the ce code. changing these values would require redesign of all ce filters and/or modifica tion of the ce pulse generator code. since these numbers are fixed for the ce code s upplied by teridian, the value of pls_interval is also fixed, to a value of 0x81. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 14 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 on-chip hardware provides a ma ximum pulse width feature: pls_maxwidth[7:0] selects a maximum negative pulse width to be nmax updates according to the formula: nmax = (2* pls_maxwidth +1). if pls_maxwidth = 255, no width checking is performed. given that pls_interval = 81, the maximum pulse width is determined by: maximum pulse width = (2 * pls_maxwidth +1) * 81*4*203ns = 65.8s + pls_maxwidth * 131.5s the ce pulse output polarity is programmable to be either positive or negative. pulse polarity may be inverted with pls_inv . when this bit is set, the pulses are active hi gh, rather than the more usual active low. ce functional overview the adc processes one sample per channel per multiplexer cycle. figure 4 shows the timing of the samples taken during one multiplexer cycle. the number of samples processed during one accumula tion cycle is controlled by the i/o ram registers pre_samps (0x2001[7:6]) and sum_cycles (0x2001[5:0]). the in tegration time for each energy output is pre_samps * sum_cycles / 2520.6, where 2520.6 is the sample rate [hz] for example, pre_samps = 42 and sum_cycles = 50 will establish 2100 samples per accumulation cycle. pre_samps = 100 and sum_cycles = 21 will result in the exact same accumulation cycle of 2100 samples or 833ms. after an accumulation cycle is completed, the xfer_busy interrupt signals to the mpu that accumula ted data are available. va ia 1/32768hz = 30.518s 13/32768hz = 397s per mux cycle ib vb figure 4: samples from multiplexer cycle the end of each multiplexer cycle is signaled to the mpu by t he ce_busy interrupt. at the end of each multiplexer cycle, status information, such as s ag data and the digitized input signal , is available to the mpu. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 15 of 97 xfer_busy interrupt to mpu 20ms 833ms figure 5: accumulation interval figure 5 shows the accumulation interval resulting from pre_samps = 42 and sum_cycles = 50, consisting of 2100 samples of 397s each, followed by the xfer_busy interrupt. the sampling in this example is applied to a 50hz signal. there is no correlation between the line signal frequency and the choice of pre_samps or sum_cycles ( even though when sum_cycles = 42 one set of sum_cycles happens to sample a period of 16.6ms). furthermore, sampling does not have to start when the line voltage crosses the zero line, and the length of the accumulation interval need not be an integer multiple of the signal cycles. it is important to note that the length of the accumulation interval, as determined by n acc , the product of sum_cycles and pre_samps, is not an exact multiple of 1000ms. for example, if sum_cycles = 60, and pre_samps = 00 (42), the resulting accumulation interval is: ms hz hz f n s acc 75. 999 62. 2520 2520 13 32768 42 60 = = ? = = this means that accurate time measurements should be not be based on the accumulation in terval without correction. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 16 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 80515 mpu core the 71m6521be includes an 80515 mpu (8-bit, 8051-compatible) that pr ocesses most instructions in one clock cycle. using a 5mhz clock results in a processing th roughput of 5 mips. the 80515 ar chitecture eliminates redundant bus states and im- plements parallel execution of fetch and ex ecution phases. normally a machine cycle is aligned with a memory fetch, there- fore, most of the 1-byte instructions ar e performed in a single cycle. this leads to an 8x performance (in average) improvement (in terms of mips) over the intel 8051 device running at the same clock frequency . actual processor clocking speed can be adjusted to the tota l processing demand of the applic ation (metering calculations, amr management, memory management, lcd driver managem ent and i/o management) using the i/o ram register mpu_div[2:0] . typical measurement and metering functions based on the results provided by the in ternal 32-bit compute engine (ce) are available for the mpu as part of teri dians standard library. a standard ansi c 80515-application programming interface library is available to help reduce design cycle. memory organization the 80515 mpu core incorporates the harvard ar chitecture with separate code and data spaces. memory organization in the 80515 is simila r to that of the industr y standard 8051. there are thr ee memory areas: program memory (flash), external data memory (xram), physically consisting of xram, ce dram, and i/o ram, and internal data memory (internal ram). table 3 shows the memory map. address (hex) memory technology memory type typical usage wait states (at 5mhz) memory size (bytes) 0000-1fff flash memory non-volatile mpu program and non- volatile data 0 8k on 1k boundary flash memory non-volatile ce program 0 2k 0000-07ff static ram volatile mpu data xram, 0 2k 1000-11ff static ram volatile ce data 6 512 2000-20ff static ram volatile configuration ram i/o ram 0 256 table 3: memory map internal and external data memory: both internal and external data memory are physically located on the 71m6521be ic. external data memory is only external to the 80515 mpu core. program memory: the 80515 can theoretically address up to 64kb of program memory space from 0x0000 to 0xffff. program memory is read when the mpu fetches instructions or performs a movc operation. after reset, the mpu starts program exec ution from location 0x0000. the lower part of the program memory includes reset and interrupt vectors. the interrupt vectors are spaced at 8-byte in tervals, starting from 0x0003. external data memory: while the 80515 is capable of addressing up to 64kb of external data memory in the space from 0x0000 to 0xffff, only the memory ranges shown in error! reference source not found. contain physical memory. the 80515 writes into external data memory when the mpu executes a mo vx @ri,a or movx @dptr, a instruction. the mpu reads external data memory by executi ng a movx a,@ri or movx a,@dptr instru ction (sfr usr2 provides the upper 8 bytes for the movx a,@ri instruction). clock stretching: movx instructions can access fast or slow external ram and external per ipherals. the three low order bits of the ckcon register define the stretch memory cycles. setting all the ckcon stretch bits to one allows access to very slow external ram or external peripherals. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 17 of 97 table 4 shows how the signals of the external me mory interface change when stretch values are set from 0 to 7. the widths of the signals are counted in mpu clock cy cles. the post-reset state of the ckcon register, which is in bold in the table, performs the movx instructions with a stretch value equal to 1. ckcon register read signals width write signal width ckcon.2 ckcon.1 ckcon.0 stretch value memaddr memrd memaddr memwr 0 0 0 0 1 1 2 1 0 0 1 1 2 2 3 1 0 1 0 2 3 3 4 2 0 1 1 3 4 4 5 3 1 0 0 4 5 5 6 4 1 0 1 5 6 6 7 5 1 1 0 6 7 7 8 6 1 1 1 7 8 8 9 7 table 4: stretch memory cycle width there are two types of instructions, diffe ring in whether they provi de an eight-bit or sixteen-bit indirect address to the exte rnal data ram. in the first type (movx a,@ri), the contents of r0 or r1, in the current register bank, provide the eight lower-ordered bits of address. the eight high-ordered bi ts of address are specified with the usr2 sfr. this method allows the user paged access (256 pages of 256 bytes each) to all ranges of the external data ra m. in the second type of movx instruction (movx a,@dptr), the data pointer generat es a sixteen-bit address. this form is faster and more efficient when accessing very large data arrays (up to 64 kbytes), since no additional instructions are needed to set up the eight high ordered bits of address. it is possible to mix the two movx types. this provides the us er with four separate data point ers, two with direct access and two with paged access to the entire 64kb of external memory range. dual data pointer: the dual data pointer accelerates the block moves of data. the standard dptr is a 16-bit register that is used to address external memory or peripherals. in the 80515 core, the standar d data pointer is called dptr , the second data pointer is called dptr1 . the data pointer select bit chooses the active pointer. the data pointer select bit is located at the lsb of the dps register ( dps.0 ). dptr is selected when dps.0 = 0 and dptr1 is selected when dps.0 = 1. the user switches between pointer s by toggling the lsb of the dps register. all dptr -related instructions use the currently selected data pointer for any activity. the second data pointer may not be supported by certain compilers. internal data memory: the internal data memory provides 256 bytes (0 x00 to 0xff) of data memory. the internal data memory address is always one byte wide and can be accessed by ei ther direct or indirect addr essing. the special function registers occupy the upper 128 bytes . this sfr area is available only by direct addressing. indirect addressing accesses the upper 128 bytes of internal ram. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 18 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 internal data memory: the lower 128 bytes contain working registers and bit-addressable memory. the lower 32 bytes form four banks of eight registers (r0-r7). two bits on the progr am memory status word ( psw ) select which bank is in use. the next 16 bytes form a block of bit-addressable memory space at bit addressees 0x00-0x7f. all of the bytes in the lower 128 bytes are accessible through direct or indirect addressing. table 5 shows the internal data memory map. address direct addressing indirect addressing 0xff 0x80 special function registers (sfrs) ram 0x7f 0x30 byte-addressable area 0x2f 0x20 bit-addressable area 0x1f 0x00 register banks r0r7 table 5: internal data memory map special function registers (sfrs) a map of the special functi on registers is shown in table 6 . bit-address- able byte-addressable hex\bin x000 x001 x010 x011 x100 x101 x110 x111 bin/hex f8 intbits ff f0 b f7 e8 wdi ef e0 a e7 d8 wdcon df d0 psw d7 c8 t2con cf c0 ircon c7 b8 ien1 ip1 s0relh s1relh usr2 bf b0 flshctl pgadr b7 a8 ien0 ip0 s0rell af a0 p2 dir2 dir0 a7 98 s0con s0buf ien2 s1con s1buf s1rell eedata eectrl 9f 90 p1 dir1 dps erase 97 88 tcon tmod tl0 tl1 th0 th1 ckcon 8f 80 p0 sp dpl dph dpl1 dph1 wdtrel pcon 87 table 6: special function registers locations only a few addresses are occupied, t he others are not implemented. sfrs s pecific to the 6521be are shown in bold print. any read access to unimplemented addresses will return undefined data, while any write access will have no effect. the registers at 0x80, 0x88, 0x90, etc., are bit-address able, all others are byte-addressable. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 19 of 97 special function registers (generic 80515 sfrs) table 7 shows the location of the sfrs and the va lue they assume at reset or power-up. name location reset value description p0 0x80 0xff port 0 sp 0x81 0x07 stack pointer dpl 0x82 0x00 data pointer low 0 dph 0x83 0x00 data pointer high 0 dpl1 0x84 0x00 data pointer low 1 dph1 0x85 0x00 data pointer high 1 wdtrel 0x86 0x00 watchdog timer reload register pcon 0x87 0x00 uart speed control tcon 0x88 0x00 timer/counter control tmod 0x89 0x00 timer mode control tl0 0x8a 0x00 timer 0, low byte tl1 0x8b 0x00 timer 1, high byte th0 0x8c 0x00 timer 0, low byte th1 0x8d 0x00 timer 1, high byte ckcon 0x8e 0x01 clock control (stretch=1) p1 0x90 0xff port 1 dps 0x92 0x00 data pointe r select register s0con 0x98 0x00 serial port 0, control register s0buf 0x99 0x00 serial po rt 0, data buffer ien2 0x9a 0x00 interrupt enable register 2 s1con 0x9b 0x00 serial port 1, control register s1buf 0x9c 0x00 serial po rt 1, data buffer s1rell 0x9d 0x00 serial port 1, reload register, low byte p2 0xa0 0x00 port 2 ien0 0xa8 0x00 interrupt enable register 0 ip0 0xa9 0x00 interrupt priority register 0 s0rell 0xaa 0xd9 serial port 0, reload register, low byte ien1 0xb8 0x00 interrupt enable register 1 ip1 0xb9 0x00 interrupt priority register 1 s0relh 0xba 0x03 serial port 0, reload register, high byte s1relh 0xbb 0x03 serial port 1, reload register, high byte usr2 0xbf 0x00 user 2 port, high address byte for movx@ri ircon 0xc0 0x00 interrupt request control register t2con 0xc8 0x00 polarity for int2 and int3 psw 0xd0 0x00 program status word wdcon 0xd8 0x00 baud rate control register (only wdcon.7 bit used) a 0xe0 0x00 accumulator b 0xf0 0x00 b register table 7: special function registers reset values downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 20 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 accumulator (acc, a): acc is the accumulator register. most instruct ions use the accumulator to hold the operand. the mnemonics for accumulator-specific instructions refer to accumulator as a, not acc. b register: the b register is used during multiply and divide instructions. it can also be used as a scratch-pad register to hold temporary data. program status word ( psw ): msb lsb cv ac f0 rs1 rs ov - p table 8: psw register flags bit symbol function psw.7 cv carry flag psw.6 ac auxiliary carry flag for bcd operations psw.5 f0 general purpose flag 0 available for user. f0 is not to be confused with the f0 flag in the ce status register. psw.4 rs1 psw.3 rs0 register bank select control bits. the c ontents of rs1 and rs0 select the working register bank: rs1/rs0 bank selected location 00 bank 0 (0x00 C 0x07) 01 bank 1 (0x08 C 0x0f) 10 bank 2 (0x10 C 0x17) 11 bank 3 (0x18 C 0x1f) psw.2 ov overflow flag psw.1 - user defined flag psw.0 p parity flag, affected by hardware to indicate odd / even number of one bits in the accumulator, i.e. even parity. table 9: psw bit functions stack pointer ( sp ): the stack pointer is a 1-byte regi ster initialized to 0x07 after reset. this register is incremented before push and call instructions, causing t he stack to begin at location 0x08. data pointer: the data pointer ( dptr ) is 2 bytes wide. the lower part is dpl , and the highest is dph . it can be loaded as two registers (e.g. mov dpl,#data8). it is generally used to acce ss external code or data space (e.g. movc a,@a+dptr or movx a,@dptr respectively). program counter: the program counter ( pc ) is 2 bytes wide initialized to 0x0000 afte r reset. this register is incremented when fetching operation code or when operat ing on data from program memory. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 21 of 97 port registers: the i/o ports are controlled by special function registers p0 , p1 , and p2 . the contents of the sfr can be observed on corresponding pins on the chip. wr iting a 1 to any of the ports (see table 10 ) causes the corresponding pin to be at high level (v3p3), and writing a 0 c auses the corresponding pin to be held at lo w level (gnd). the data direction register s dir0 , dir1 , and dir2 define individual pins as input or output pins (see section digital i/o for details). register sfr address r/w description p0 0x80 r/w register for port 0 read and write operations (pins dio4dio7) dir0 0xa2 r/w data direction register for port 0. se tting a bit to 1 means that the corresponding pin is an output. p1 0x90 r/w register for port 1 read and write oper ations (pins dio8dio11, dio14dio15) dir1 0x91 r/w data direction register for port 1. p2 0xa0 r/w register for port 2 read and write operations (pins dio16dio17) dir2 0xa1 r/w data direction register for port 2. table 10: port registers all dio ports on the chip are bi-directional. ea ch of them consists of a latch (sfr p0 to p2 ), an output driver, and an input buffer, therefore the mpu can out put or read data through any of these ports. even if a dio pin is configured as an output, the state of the pin can still be read by the mpu, for example when counting pulses issued via dio pins that are under ce control. the technique of reading the status of or generating in terrupts based on dio pins c onfigured as out puts, can be used to implement pulse counting. special function registers specific to the 71m6521be table 11 shows the location and description of the 71m6521be-specific sfrs. register alternative name sfr address r/w description erase flsh_erase 0x94 w this register is used to initiate either the flash mass erase cycle or the flash page erase cycle. spec ific patterns are expected for flsh_erase in order to initiate the appropriate erase cycle (default = 0x00). 0x55 C initiate flash page erase cy cle. must be preceded by a write to flsh_pgadr @ sfr 0xb7. 0xaa C initiate flash mass erase cy cle. must be preceded by a write to flsh_meen @ sfr 0xb2 and the debug port must be enabled. any other pattern written to flsh_erase will have no effect. pgaddr flsh_pgadr 0xb7 r/w flash page erase address register containing the flash memory page address (page 0 thru 127) that w ill be erased during the page erase cycle (default = 0x00). must be re-written for each new page erase cycle. eedata 0x9e r/w i 2 c eeprom interface data register eectrl 0x9f r/w i 2 c eeprom interface control register . if the mpu wishes to write a byte of data to eeprom, it places the data in eedata and then writes the transmit code to eectrl . the write to eectrl initiates the transmit sequence. see the eepr om interface section for a description of the command and st atus bits available for eectrl . downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 22 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 flshcrl 0xb2 r/w w r/w r bit 0 ( flsh_pwe ): program write enable: 0 C movx commands refer to xram space, normal operation (default). 1 C movx @dptr,a moves a to program space (flash) @ dptr. this bit is automatically reset after each byte written to flash. writes to this bit are inhibited when interrupts are enabled. bit 1 ( flsh_meen ): mass erase enable: 0 C mass erase disabled (default). 1 C mass erase enabled. must be re-written for each new mass erase cycle. bit 6 ( secure ): enables security provisions that prevent external reading of flash memory and ce program ram. this bit is reset on chip reset and may only be set. attempts to write zero are ignored. bit 7 ( preboot ): indicates that the pr eboot sequence is active. wdi 0xe8 r/w r/w w only byte operations on the whole wdi register should be used when writing . the byte must have all bits set except the bits that are to be cleared. the multi-purpose register wdi contains the following bits: bit 0 ( ie_xfer ): xfer interrupt flag: this flag monitors the xfer_busy interrupt. it is set by hardware and must be cleared by the interrupt handler bit 1: reserved bit 7 ( wd_rst ): wd timer reset: read: reads the pll_fall interrupt flag write 0: clears the pll_fall interrupt flag write 1: resets the watch dog timer intbits int0int6 0xf8 r interrupt inputs. the mpu may read these bits to see the input to external interrupts int0, int1, up to int6. these bits do not have any memory and are primarily intended for debug use table 11: special function registers instruction set all instructions of the generic 8051 microcontroller are supported. a complete list of the instruction se t and of the associate d op-codes is contained in the 71m6521 software users guide (sug). uart the 71m6521be includes a uart (uart0) that can be programm ed to communicate with a variety of amr modules. a second uart (uart1) is connected to the optical port, as described in the optical port description. the uart is a dedicated 2-wire serial inte rface, which can communicate with an exte rnal host processor at up to 38,400 bits/s ((with mpu clock = 1.2288mhz). the oper ation of each pin is as follows: rx : serial input data are applied at this pin. confo rming to rs-232 standard, the bytes are input lsb first. tx : this pin is used to output the serial data. the bytes are output lsb first. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 23 of 97 the 71m6521be has several uart-related regist ers for the control and buffering of serial data. all uart transfers are pro- grammable for parity enable, parity, 2 st op bits/1 stop bit and xon/xoff options fo r variable communication baud rates from 300 to 38400 bps. table 12 shows how the baud rates are calculated. table 13 shows the selectable uart operation modes. using timer 1 using internal baud rate generator uart0 2 smod * f ckmpu / (384 * (256-th1)) 2 smod * f ckmpu /(64 * (2 10 - s0rel )) uart1 n/a f ckmpu /(32 * (2 10 - s1rel )) note: s0rel and s1rel are 10-bit values derived by combining bits from the respective timer reload registers. smod is the smod bit in the sfr pcon . th1 is the high byte of timer 1 . table 12: baud rate generation uart 0 uart 1 mode 0 n/a start bit, 8 data bits, parity, stop bit, variable baud rate (internal baud rate generator) mode 1 start bit, 8 data bits, stop bit, variable baud rate (internal baud rate generator or timer 1) start bit, 8 data bits, stop bit, variable baud rate (internal baud rate generator) mode 2 start bit, 8 data bits, parity, stop bit, fixed baud rate 1/32 or 1/64 of f ckmpu n/a mode 3 start bit, 8 data bits, parity, stop bit, variable baud rate (internal baud rate generator or timer 1) n/a table 13: uart modes parity of serial data is available thr ough the p flag of the accumulator. seven-bi t serial modes with parity, such as those used by the flag protocol, can be simulated by setting and reading bi t 7 of 8-bit output data. seven-bit serial modes without parity can be simulated by setting bit 7 to a constant 1. 8-bi t serial modes with parity can be simulated by setting and reading the 9 th bit, using the control bits tb80 ( s0con .3) and tb81 ( s1con .3) in the s0con and s1con sfrs for transmit and rb81 ( s1con .2) for receive operations. sm20 ( s0con .5) and sm21 ( s1con .5) can be used as handshake signals for inter-processor communi cation in multi-processor systems. serial interface 0 control register ( s0con ). the function of the uart0 depends on the setting of the serial port control register s0con . msb lsb sm0 sm1 sm20 ren0 tb80 rb80 ti0 ri0 table 14: the s0con register serial interface 1 control register (s1con). the function of the serial port depends on the se tting of the serial port control register s1con . msb lsb sm - sm21 ren1 tb81 rb81 ti1 ri1 table 15: the s1con register downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 24 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 bit symbol function s0con.7 sm0 s0con.6 sm1 these two bits set the uart0 mode: mode description sm0 sm1 0 n/a 0 0 1 8-bit uart 0 1 2 9-bit uart 1 0 3 9-bit uart 1 1 s0con.5 sm20 enables the inter-processor communication feature. s0con.4 ren0 if set, enables serial reception. cleared by software to disable reception. s0con.3 tb80 the 9 th transmitted data bit in modes 2 and 3. set or cleared by the mpu, depending on the function it performs (parity check, multiprocessor communication etc.) s0con.2 rb80 in modes 2 and 3 it is the 9 th data bit received. in mode 1, if sm20 is 0, rb80 is the stop bit. in mode 0 this bi t is not used. must be cleared by software s0con.1 ti0 transmit interrupt flag, set by hardw are after completion of a serial transfer. must be cleared by software. s0con.0 ri0 receive interrupt flag, set by hardw are after completion of a serial reception. must be cleared by software table 16: the s0con bit functions bit symbol function s1con.7 sm sets the baud rate for uart1 sm mode description baud rate 0 a 9-bit uart variable 1 b 8-bit uart variable s1con.5 sm21 enables the inter-processor communication feature. s1con.4 ren1 if set, enables serial reception. cleared by software to disable reception. s1con.3 tb81 the 9 th transmitted data bit in mode a. set or cleared by the mpu, depending on the function it performs (parity check, multiprocessor communication etc.) s1con.2 rb81 in modes a and b, it is the 9 th data bit received. in mode b, if sm21 is 0, rb81 is the stop bit. must be cleared by software s1con.1 ti1 transmit interrupt flag, set by hardw are after completion of a serial transfer. must be cleared by software. s1con.0 ri1 receive interrupt flag, set by hardw are after completion of a serial reception. must be cleared by software table 17: the s1con bit functions downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 25 of 97 timers and counters the 80515 has two 16-bit timer/counter registers: timer 0 and timer 1. these register s can be configured for counter or timer operations. in timer mode, the register is increment ed every machine cycle meaning that it c ounts up after every 12 periods of the mpu clock signal. in counter mode, the register is incremented when the falling edge is observed at the correspondi ng input signal t0 or t1 (t0 and t1 are the timer gating inputs derived fr om certain dio pins, see the dio ports chapter). since it takes two machine cycles to recognize a 1-to-0 event, the maximum input count ra te is 1/2 of the oscillator fr equency. there are no restrictions on the duty cycle, however to ensure proper recognition of 0 or 1 state, an input should be stable for at least 1 machine cycle. the timers/counters are controlled by the tcon register timer/counter control register ( tcon ) msb lsb tf1 tr1 tf0 tr0 ie1 it1 ie0 it0 table 18: the tcon register bit symbol function tcon.7 tf1 the timer 1 overflow flag is set by hardware when timer 1 overflows. this flag can be cleared by software and is automat ically cleared when an interrupt is processed. tcon.6 tr1 timer 1 run control bit. if cleared, timer 1 stops. tcon.5 tf0 timer 0 overflow flag set by hardware when timer 0 overflows. this flag can be cleared by software and is automatically cleared when an interrupt is processed. tcon.4 tr0 timer 0 run control bit. if cleared, timer 0 stops. tcon.3 ie1 interrupt 1 edge flag is set by hardware when the falling edge on external pin int1 is observed. cleared when an interrupt is processed. tcon.2 it1 interrupt 1 type control bit. selects eit her the falling edge or low level on input pin to cause an interrupt. tcon.1 ie0 interrupt 0 edge flag is set by hardware when the falling edge on external pin int0 is observed. cleared when an interrupt is processed. tcon.0 it0 interrupt 0 type control bit. selects eit her the falling edge or low level on input pin to cause interrupt. table 19: the tcon register bit functions downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 26 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 four operating modes can be selected for timer 0 and timer 1. two special function registers ( tmod and tcon ) are used to select the appropriate mode. timer/counter mode control register ( tmod ): msb lsb gate c/t m1 m0 gate c/t m1 m0 timer 1 timer 0 table 20: the tmod register bits tr1 ( tcon .6) and tr0 ( tcon .4) in the tcon register (see table 18 and table 19 ) start their associated timers when set. bit symbol function tmod.7 tmod.3 gate if set, enables external gate control (pin int0 or int1 for counter 0 or 1, respectively). when int0 or int1 is high, and trx bit is set (see tcon register), a counter is incremented every fa lling edge on t0 or t1 input pin tmod.6 tmod.2 c/t selects timer or counter operation. w hen set to 1, a counter operation is performed. when cleared to 0, the corres ponding register will function as a timer. tmod.5 tmod.1 m1 selects the mode for timer/counter 0 or timer/counter 1, as shown in tmod description. tmod.4 tmod.0 m0 selects the mode for timer/counter 0 or timer/counter 1, as shown in tmod description. table 21: tmod register bit description m1 m0 mode function 0 0 mode 0 13-bit counter/timer with 5 lower bits in the tl0 or tl1 register and the remaining 8 bits in the th0 or th1 register (for timer 0 and timer 1, respectively). the 3 high order bits of tl0 and tl1 are held at zero. 0 1 mode 1 16-bit counter/timer. 1 0 mode 2 8-bit auto-reload counter/tim er. the reload value is kept in th0 or th1 , while tl0 or tl1 is incremented every machine cycle. when tl (x) overflows, a value from th (x) is copied to tl (x). 1 1 mode 3 if timer 1 m1 and m0 bits are set to '1', timer 1 stops. if timer 0 m1 and m0 bits are set to '1', timer 0 acts as two independent 8-bit timer/counters. table 22: timers/counters mode description note: in mode 3, tl0 is affected by tr0 and gate control bits, and sets the tf0 flag on overflow, while th0 is affected by the tr1 bit, and the tf1 flag is set on overflow. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 27 of 97 table 23 specifies the combinations of operation modes allowed for timer 0 and timer 1: timer 1 mode 0 mode 1 mode 2 timer 0 - mode 0 yes yes yes timer 0 - mode 1 yes yes yes timer 0 - mode 2 not allowed not allowed yes table 23: timer modes timer/counter mode control register ( pcon ): msb lsb smod -- -- -- -- -- -- -- table 24: the pcon register the smod bit in the pcon register doubles the baud rate when set. bit symbol function pcon.7 smod table 25: pcon register bit description wd timer (software watchdog timer) the software watchdog timer is a 16-bit counter that is incremented once every 24 or 384 clock cycles. after a reset, the watchdog timer is disabled and all registers are set to zero. the watchdog consists of a 16-bit counter ( wdt ), a reload register ( wdtrel ), prescalers (by 2 and by 16), and control logic. once the watchdog is started, it cannot be stopped unless the internal reset signal becomes active. note: it is recommended to use the hardware watchdog timer instead of the software watchdog timer. wd timer start procedure: the wdt is started by setting the swdt flag. when the wdt register enters the state 0x7cff, an asynchronous wdts signal will become active. the signal wdts sets bit 6 in the ip0 register and requests a reset state. wdts is cleared either by the reset signal or by changing the stat e of the wdt timer. refreshing the wd timer: the watchdog timer must be refreshed regularly to prevent the reset request signal from becoming active. this requirement imposes an obligat ion on the programmer to issue two instruct ions. the first instruction sets wdt and the second instruction sets swdt . the maximum delay allowed between setting wdt and swdt is 12 clock cycles. if this period has expired and swdt has not been set, the wdt is automatically reset, otherwise the watchdog timer is reloaded with the content of the wdtrel register and the wdt is automatically reset. si nce the wdt requires exact timing, firmware needs to be designed with special care in order to avoid unwanted wdt resets. teridian strongly discourages the use of the software wdt. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 28 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 special function registers for the wd timer interrupt enable 0 register ( ien0 ): msb lsb eal wdt et2 es0 et1 ex1 et0 ex0 table 26: the ien0 register (see also table 32) bit symbol function ien0.6 wdt watchdog timer refresh flag. set to initiate a refresh of the watc hdog timer. must be set directly before swdt is set to prevent an unintentional refresh of the watchdog timer. wdt is reset by hardware 12 clock cycles after it has been set. table 27: the ien0 bit functions (see also table 32) note: the remaining bits in the ien0 register are not used for watchdog control interrupt enable 1 register ( ien1 ): msb lsb exen2 swdt ex6 ex5 ex4 ex3 ex2 table 28: the ien1 register (see also tables 30/31) bit symbol function ien1.6 swdt watchdog timer start/refresh flag. set to activate/refresh the watchdog ti mer. when directly set after setting wdt , a watchdog timer refresh is performed. bit swdt is reset by the hardware 12 clock cycles after it has been set. table 29: the ien1 bit functions (see also tables 31/32) note: the remaining bits in the ien1 register are not used for watchdog control downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 29 of 97 interrupt priority 0 register ( ip0 ): msb lsb -- wdts ip0.5 ip0.4 ip 0.3 ip0.2 ip0.1 ip0.0 table 30: the ip0 register (see also table 45) bit symbol function ip0.6 wdts watchdog timer status flag. set when t he watchdog timer was started. can be read by software. table 31: the ip0 bit functions (see also table 45) note: the remaining bits in the ip0 register are not used for watchdog control watchdog timer reload register ( wdtrel ): msb lsb 7 6 5 4 3 2 1 0 table 32: the wdtrel register bit symbol function wdtrel .7 7 prescaler select bit. when set, the watchdog is clocked through an additional divide-by-16 prescaler wdtrel .6 to wdtrel .0 6-0 seven bit reload value for the high-byte of the watchdog timer. this value is loaded to the wdt when a refresh is triggered by a consecutive setting of bits wdt and swdt . table 33: the wdtrel bit functions the wdtrel register can be loaded and read at any time. interrupts the 80515 provides 11 interrupt sources with four priority levels. each source has its own request flag(s) located in a special function register ( tcon , ircon , and scon ). each interrupt requested by the corre sponding flag can be individually enabled or disabled by the enable bits in sfrs ien0 , ien1 , and ien2 . external interrupts are the interrupts external to the 80515 core, i.e. signals that originate in other parts of the 71m6521be, for example the ce, dio, eeprom interface. interrupt overview when an interrupt occurs, the mpu will vector to the predetermined address as shown in table 52 . once interrupt service has begun, it can be interrupted only by a higher priority interrupt. t he interrupt service is terminated by a return from instruct ion, "reti". when an reti is performed, the processor will return to the instruction that woul d have been next when the interrupt occurred. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 30 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 when an interrupt occurs, the mpu will vector to the predetermined address as shown in table 52 . once interrupt service has begun, it can be interrupted only by a higher priority interrupt. t he interrupt service is terminated by a return from instruct ion, "reti". when a reti instruction is perform ed, the processor will return to the in struction that woul d have been next when the interrupt occurred. when the interrupt condition occurs, the processor will also indi cate this by setting a flag bit. this bit is set regardless of whether the interrupt is enabled or disabled. each interrupt flag is sampled onc e per machine cycle, then samples are polled by the hardware. if the sample indicate s a pending interrupt when the interrupt is enabled, then the interr upt request flag is set. on the next instruction cycle, the inte rrupt will be acknowledged by hardware forc ing an lcall to the appropriate vector address, if the following conditions are met: ? no interrupt of equal or higher priority is already in progress. ? an instruction is currently bei ng executed and is not completed. ? the instruction in progress is not reti or any write access to the registers ien0 , ien1 , ien2 , ip0 or ip1 . special function registers for interrupts: interrupt enable 0 register ( ie0 ) msb lsb eal wdt es0 et1 ex1 et0 ex0 table 34: the ien0 register bit symbol function ien0.7 eal eal=0 C disable all interrupts ien0.6 wdt not used for interrupt control ien0.5 - ien0.4 es0 es0=0 C disable serial channel 0 interrupt ien0.3 et1 et1=0 C disable timer 1 overflow interrupt ien0.2 ex1 ex1=0 C disable external interrupt 1 ien0.1 et0 et0=0 C disable timer 0 overflow interrupt ien0.0 ex0 ex0=0 C disable external interrupt 0 table 35: the ien0 bit functions interrupt enable 1 register ( ien1 ) msb lsb swdt ex6 ex5 ex4 ex3 ex2 table 36: the ien1 register downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 31 of 97 bit symbol function ien1.7 - ien1.6 swdt not used for interrupt control ien1.5 ex6 ex6 =0 C disable external interrupt 6 ien1.4 ex5 ex5 =0 C disable external interrupt 5 ien1.3 ex4 ex4 =0 C disable external interrupt 4 ien1.2 ex3 ex3 =0 C disable external interrupt 3 ien1.1 ex2 ex2 =0 C disable external interrupt 2 ien1.0 - table 37: the ien1 bit functions interrupt enable 2 register ( ie2 ) msb lsb - - - - - - - es1 table 38: the ien2 register bit symbol function ien2.0 es1 es1 =0 C disable serial channel 1 interrupt table 39: the ien2 bit functions timer/counter control register ( tcon ) msb lsb tf1 tr1 tf0 tr0 ie1 it1 ie0 it0 table 40: the tcon register bit symbol function tcon.7 tf1 timer 1 overflow flag tcon.6 tr1 not used for interrupt control tcon.5 tf0 timer 0 overflow flag tcon.4 tr0 not used for interrupt control tcon.3 ie1 external interrupt 1 flag tcon.2 it1 external interrupt 1 type control bit tcon.1 ie0 external interrupt 0 flag tcon.0 it0 external interrupt 0 type control bit table 41: the tcon bit functions downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 32 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 timer2/counter2 control register ( t2con ): bit symbol function t2con.7 -- not used t2con.6 i3fr polarity control for int3: 0 - falling edge, 1 C rising edge t2con.5 i2fr polarity control for int3: 0 - falling edge, 1 C rising edge tcon.4 t2con0 -- not used table 42: the t2con bit functions interrupt request register ( ircon ) msb lsb ex6 iex5 iex4 iex3 iex2 table 43: the ircon register bit symbol function ircon.7 - ircon.6 - ircon.5 iex6 external interrupt 6 edge flag ircon.4 iex5 external interrupt 5 edge flag ircon.3 iex4 external interrupt 4 edge flag ircon.2 iex3 external interrupt 3 edge flag ircon.1 iex2 external interrupt 2 edge flag ircon.0 - table 44: the ircon bit functions note: only tf0 and tf1 (timer 0 and timer 1 overflow flag) will be automatically cleared by hardware when the service routine is called (signals t0ack and t1ack C port isr C active high when the service routine is called). downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 33 of 97 external interrupts the 71m6521be mpu allows seven external inte rrupts. these are c onnected as shown in table 45 . the direction of interrupts 2 and 3 is programmable in the mpu. interrupts 2 and 3 should be programmed for falling sensitivity. the generic 8051 mpu literature states t hat interrupt 4 through 6 are defi ned as rising edge sensitive. thus, the hardware signals attached to interrupts 5 and 6 are inverted to achieve the edge polarity shown in table 45 . external interrupt connection polarity flag reset 0 digital i/o high priority see dio_rx automatic 1 digital i/o low priority see dio_rx automatic 2 fwcol0, fwcol1 falling automatic 3 ce_busy falling automatic 4 pll_ok (rising), pll_ok (f alling) rising automatic 5 eeprom busy falling automatic 6 xfer_busy falling manual table 45: external mpu interrupts fwcolx interrupts occur when the ce collides with a flash writ e attempt. see the flash write description for more detail. sfr (special function register) enable bits must be set to permit any of these interrupts to occur. likewise, each interrupt ha s its own flag bit, which is set by the in terrupt hardware, and reset by the mpu in terrupt handler. note that xfer_busy, fwcol0, fwcol1, pllrise, p llfall, have their own enable and flag bits in addition to the interrupt 6, 4, and 2 enable and flag bits. ie0 through iex6 are cleared automatically when the hardware vectors to the in terrupt handler. the other flags, ie_xfer through ie_pb , are cleared by writing a zero to them. since these bi ts are in a bit-addressable sfr byte, common practice would be to clear them with a bit operation. this is to be av oided. the hardware implements bit operations as a byte wide read- modify-write hardware macro. if an interrupt occurs after t he read, but before t he write, its flag w ill be cleared unintentiona lly. the proper way to clear the flag bits is to write a byte mask c onsisting of all ones except for a zero in the location of the b it to be cleared. the flag bits are configured in hardware to ignore ones written to them. interrupt enable interrupt flag name location name location interrupt description ex0 sfr a8[[0] ie0 sfr 88[1] external interrupt 0 ex1 sfr a8[2] ie1 sfr 88[3] external interrupt 1 ex2 sfr b8[1] iex2 sfr c0[1] external interrupt 2 ex3 sfr b8[2] iex3 sfr c0[2] external interrupt 3 ex4 sfr b8[3] iex4 sfr c0[3] external interrupt 4 ex5 sfr b8[4] iex5 sfr c0[4] external interrupt 5 ex6 sfr b8[5] iex6 sfr c0[5] external interrupt 6 ex_xfer 2002[0] ie_xfer sfr e8[0] xfer_busy interrupt (int 6) ie_fwcol0 sfr e8[3] fwcol0 interrupt (int 2) ex_fwcol 2007[4] ie_fwcol1 sfr e8[2] fwcol1 interrupt (int 2) ie_pllrise sfre8[6] pll_ok rise interrupt (int 4) ex_pll 2007[5] ie_pllfall sfre8[7] pll_ok fall interrupt (int 4) ie_wake sfre8[5] autowake flag ie_pb sfre8[4] pb flag table 46: interrupt enable and flag bits downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 34 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 the autowake and pb flag bits are shown in table 46 because they behave similarly to in terrupt flags, even though they are not actually related to an interrupt. these bits are set by hardware when the mpu wakes from a push button or wake timeout. the bits are reset by writing a zero. note that the pb flag is set whenever the pb is pushed, ev en if the part is already awake . each interrupt has its own flag bit, which is set by the inte rrupt hardware and is reset automat ically by the mpu interrupt handler (0 through 5). xfer_busy has its own enable and flag bit in addition to the interrupt 6 enable and flag bit (see table 46 ), and these interrupts must be cleared by the mpu software. the external interrupts ar e connected as shown in table 46 . the polarity of interrupts 2 and 3 is programmable in the mpu via the i3fr and i2fr bits in t2con . interrupts 2 and 3 should be programmed fo r falling sensitivity. the generic 8051 mpu literature states t hat interrupts 4 through 6 are defined as rising edge s ensitive. thus, the hardware signals attached to interrupts 5 and 6 are inverted to achieve the edge polarity shown in table 46 . sfr (special function register) enable bits must be set to permit any of these interrupts to occur. likewise, each interrupt ha s its own flag bit that is set by the inte rrupt hardware and is reset automatically by the mpu interrupt handler (0 through 5). interrupt priority level structure all interrupt sources are combined in groups, as shown in table 47 . each group of interrupt sources can be progr ammed individually to one of four priority levels by setting or clearing one bit in the special function register ip0 and one in ip1 . if requests of the same priority leve l are received simultaneously, an internal polling sequence as per table 51 determines which request is serviced first. an overview of the interr upt structure is given in figure 6 . group 0 external interrupt 0 serial channel 1 interrupt 1 timer 0 interrupt - external interrupt 2 2 external interrupt 1 - external interrupt 3 3 timer 1 interrupt - external interrupt 4 4 serial channel 0 interrupt - external interrupt 5 5 - - external interrupt 6 table 47: priority level groups ien enable bits must be set to permit any of these interrupts to occur. likewise, each interrupt has its own flag bit that is s et by the interrupt hardware and is reset automat ically by the mpu interrupt handler (0 through 5). xfer_busy has its own enable and flag bit in addition to the interrupt 6 enable and flag bit (see table 46 ) and this interrupt must be cleared by the mpu software. interrupt priority 0 register ( ip0 ) msb lsb -- wdts ip0.5 ip0.4 ip 0.3 ip0.2 ip0.1 ip0.0 table 48: the ip0 register note: wdts is not used for interrupt controls interrupt priority 1 register ( ip1 ) msb lsb - - ip1.5 ip1.4 ip1. 3 ip1.2 ip1.1 ip1.0 table 49: the ip1 register: downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 35 of 97 ip1.x ip0.x priority level 0 0 level0 (lowest) 0 1 level1 1 0 level2 1 1 level3 (highest) table 50: priority levels external interrupt 0 serial channel 1 interrupt timer 0 interrupt external interrupt 2 external interrupt 1 external interrupt 3 timer 1 interrupt external interrupt 4 serial channel 0 interrupt external interrupt 5 external interrupt 6 polling sequence table 51: interrupt polling sequence interrupt sources and vectors table 52 shows the interrupts with their a ssociated flags and vector addresses. interrupt request flag description interrupt vector address ie0 external interrupt 0 0x0003 tf0 timer 0 interrupt 0x000b ie1 external interrupt 1 0x0013 tf1 timer 1 interrupt 0x001b ri0/ti0 serial channel 0 interrupt 0x0023 ri1/ti1 serial channel 1 interrupt 0x0083 iex2 external interrupt 2 0x004b iex3 external interrupt 3 0x0053 iex4 external interrupt 4 0x005b iex5 external interrupt 5 0x0063 iex6 external interrupt 6 0x006b table 52: interrupt vectors downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 36 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 ie0 individual interrupt flags ri1 ti1 general interrupt flags internal/ external source >=1 tf0 int2 ie1 int3 tf1 int4 ri0 ti0 >=1 int5 int6 ircon.1 i2fr ircon.2 i3fr ircon.3 ircon.4 ircon.5 ien0.7 ip1.0/ ip0.0 ip1.1/ ip0.1 ip1.2/ ip0.2 ip1.3/ ip0.3 ip1.4/ ip0.4 ip1.5/ ip0.5 interrupt control register priority assignment interrupt vector p o l l i n g s e q u e n c e interrupt enable logic and polarity selection dio uart1 (optical) timer 0 dio timer 1 ce_busy uart0 eeprom/ i2c xfer_busy rtc_1s ien0.0ien2.0 ien0.1 ien1.1ien0.2 ien1.2 ien0.3 ien1.3 ien0.4 ien1.4 ien1.5 ie_xfer ie_rtc flash write collision ie_fwcol0 ie_fwcol1 pll ok ie_pllrise ie_pllfall figure 6: interrupt structure downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 37 of 97 on-chip resources oscillator the 71m6521be oscillator drives a standard 32. 768khz watch crystal. these crystals are accurate and do not require a high- current oscillator circuit. the 71m6521be oscillator has been designed specifically to handle these crystals and is compatible with their high impedance and lim ited power handling capability. pll and internal clocks timing for the device is derived from the 32.768khz oscillator output. on-chip timing functions include the mpu master clock and the delta-sigma sample clock. in addition, the mpu has two general counter/timers (see mpu section). the adc master clock, ckadc, is generat ed by an on-chip pll. it multiplies the o scillator output frequency (ck32) by 150. the ce clock frequency is always ck32 * 150, or 4.9152mhz, w here ck32 is the 32khz clock. the mpu clock frequency is determined by mpu_div and can be 4.9152mhz *2 - mpu_div hz where mpu_div varies from 0 to 7 ( mpu_div is 0 on power- up). this makes the mpu clock scalable from 4.9152mhz down to 38.4khz. the circuit also generates a 2x mpu clock for use by the emulator. this clock is not generated when eck_dis is asserted by the mpu. the setting of mpu_div is maintained when the device transitions to br ownout mode, but the time base in brownout mode is 28,672hz. temperature sensor the device includes an on-chip temperatur e sensor for determining the temperatur e of the bandgap reference. the mpu may request an alternate multiplexer frame containing the temperatur e sensor output by asserting mux_alt . the primary use of the temperature data is to determine the magnitude of compens ation required to offset the t hermal drift in the system (see section titled temperature compensation). physical memory flash memory: the 71m6521 includes 8kb of on-chip flash memory. the flash memory primarily contains mpu and ce program code. it also contains images of the ce dram, mpu ram, and i/o ram. on power-up, before enabling the ce, the mpu copies these images to their respective locations. allocated flash space for the ce pr ogram cannot exceed 1024 words (2kb). the ce program must begin on a 1kb boundary of the flash address. the ce_lctn[4:0] word defines which 1kb boundary contains the ce code. thus, the first ce instruction is located at 1024* ce_lctn[4:0] . the ce_lctn[4:0] register must be set bef ore the ce is enabled. the flash memory is segmented into 512 byte individually erasable pages. the ce engine cannot access its program memory when flash wr ite occurs. thus, the flash write procedure is to begin a sequence of flash writes when ce_busy falls (ce_busy interrupt) and to make sure ther e is sufficient time to complete the sequence before ce_busy rises again. the ac tual time for the flash write operati on will depend on the exact number of cycles required by the ce program. typically (c e program is 512 instructions, mux frame is 13 ck32 cycles), there will be 200s of flash write time, enough for 4 bytes of flash write. if the ce code is shorter, there will be even more time. two interrupts warn of collisions between the 8051 firmware and the ce timing. if a flas h write is attempted while the ce is busy, the flash write will not execute and the fw_col0 interrupt will be issued. if a flash write is still in progress when the ce would otherwise begin a code pass, the code pass is skipped, the write is completed, and the fw_col1 interrupt is issued. the bit flash66z (see i/o ram table) defines the speed for accessing flash memory. to minimize supply current draw, this bit should be set to 1. flash erasure is initiated by writing a specific data pattern to specific sfr registers in the proper sequence. these special pattern/sequence requirements prevent inadver tent erasure of the flash memory. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 38 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 the mass erase sequence is: 1. write 1 to the flsh_meen bit (sfr address 0xb2[1]. 2. write pattern 0xaa to flsh_erase (sfr address 0x94) the mass erase cycle can only be init iated when the ice port is enabled. the page erase sequence is: 1. write the page address to flsh_pgadr (sfr address 0xb7[7:1] 2. write pattern 0x55 to flsh_erase (sfr address 0x94) the mpu may write to the flash memory. this is one of the non- volatile storage options available to the user in addition to external eeprom. flsh_pwe (flash program write enable) diffe rentiates 80515 data store instructions (movx@dpt r,a) between flash and xram writes. updating individual bytes in flash memory: the original state of a flash byte is 0x ff (all ones). once, a value other than 0xff is written to a flash memory cell, overwri ting with a different value usually requires that the cell is erased first. since cells cannot be erased individually, the page has to be copied to ram, followed by a page erase. after this, t he page can be updated in ram and then written back to the flash memory. mpu ram: the 71m6521be includes 2k-bytes of static ram memory on-chip (xram) plus 256-bytes of internal ram in the mpu core. the 2k-bytes of static ram are us ed for data storage during normal mpu operations. ce dram : the ce dram is the working data memory of the ce (128 32-bit words). the mpu can read and write the ce dram as the primary means of data co mmunication between the two processors. optical interface the device includes an interface to implement an ir/optical port. the pin opt_tx is des igned to directly drive an external led for transmitting data on an optical link. the pin opt_rx is designed to sense the input from an external photo detector used as the receiver for the optical link. these two pi ns are connected to a dedicated uart port (uart1). the opt_tx and opt_rx pins can be inverted with configuration bits opt_txinv and opt_rxinv , respectively. additionally, the opt_tx output may be modul ated at 38khz. modulation is available when system power is present (i.e. not in brownout mode). the opt_txmod bit enables modulation. duty cycle is controlled by opt_fdc[1:0] , which can select 50%, 25%, 12.5%, and 6.25% duty cycle. 6.25% duty cycle means opt_tx is low for 6.25% of the period. figure 7 illustrates the opt_tx generator. when not needed for the optical uart, the opt_tx pin can alternatively be c onfigured as dio2 or wpulse. the configuration bits are opt_txe[1:0] . likewise, opt_rx can alternately be configured as dio_1. its control is opt_rxdis. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 39 of 97 b a opt_txinv from opt_tx uart mod en duty opt_tx opt_txmod opt_fdc opt_txe[1:0] 1 2 v3p3 internal ab opt_txmod=0 opt_txmod=1, opt_fdc=2 (25%) b a 1/38khz 0 2 dio2 wpulse figure 7: optical interface digital i/o the device includes up to 14 pins of general purpose digital i/o. these pins are compatible with 5v inputs (no current-limiting resistors are needed). some are dual function that can alternatively be used as lcd drivers (dio4- 11, 14-17) and some share functions with the optical port (dio1, dio2). on reset or powe r-up, all dio pins are inputs unt il they are configured for the desired direction under mpu control. the pins are configured by the dio regi sters and by the five bits of the lcd_num register (located in i/o ram). once declared as dio, each pi n can be configured independently as an input or output with the dio_dirn bits. a 3-bit configuration word, dio_rx , can be used for certain pins, when configured as dio, to individually assign an internal resource such as an interrupt or a timer control. table 53 lists the direction register s and configurability associated with each group of dio pins. table 54 shows the configuration for a dio pin through its associated bit in its dio_dir register. tables showing the relationship between lcd_num and the available segment/dio pins can be found in the applications section and in the i/o ram description under lcd_num[4:0]. dio pb 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 pin number 62 57 3 -- 37 38 39 40 41 42 43 44 -- -- 20 21 0 1 2 -- 4 5 6 7 0 1 2 3 -- -- 6 7 data register dio0=p0 (sfr 0x80) dio1=p1 (sfr 0x90) 0 1 2 -- 4 5 6 7 0 1 2 3 -- -- 6 7 direction register dio_dir0 (sfr 0xa2) dio_dir1 (sfr 0x91) internal resources configurable y y y -- y y y y y y y y -- -- -- -- dio 16 17 18 19 20 21 22 23 pin number 22 12 -- -- -- -- -- -- 0 1 -- -- -- -- -- -- data register dio2=p2 (sfr 0xa0) 0 1 -- -- -- -- -- -- direction register dio_dir2 (sfr 0xa1) internal resources configurable n n -- -- -- -- -- -- table 53: data/direction registers and internal resources for dio pin groups downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 40 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 dio_dir [n] 0 1 dio pin n function input output table 54: dio_dir control bit additionally, if dio6 is declared an output, it can be conf igured as dedicated pulse output (wpulse = dio6) using the dio_pw register. in this case, dio6 is under ce control. dio4 and dio5 can be configured to implement the eeprom interface. the pb pin is a dedicated digital input. if the optical uart is not used, opt_tx and opt_rx can be configured as dedicated dio pins (dio1, dio2, see op tical interface section). a 3-bit configuration word, i/o ram register, dio_rx (0x2009[2:0] through 0x200e[6:4]) can be used for certain pins, when configured as dio, to individually assign an internal re source such as an interrupt or a timer control (see table 55 for dio pins available for this option). this way, dio pins c an be tracked even if they are configured as outputs. tracking dio pins configured as outputs is usef ul for pulse counting wit hout external hardware. when driving leds, relay coils etc., the dio pins should sink the current into gndd (as shown in figure 8 , right), not source it from v3p3d (as shown in figure 8 , left). this is due to the resistance of the internal switch that connects v3p3d to either v3p3sys or vbat. when configured as inputs, the dual-function (dio/ seg) pins should not be pulled above v3p3sys in mission and above vbat in lcd and brownout modes. doing so will distort th e lcd waveforms of the other pins. this limitation applies to any pin that can be configured as a lcd driver. 71m6521b not recommended dio1 v3p3d r led v3p3sys 3.3v dgnd vbat 71m6521b not recommended dio1 v3p3d r led v3p3sys recommended r led 3.3v dgnd vbat figure 8: connecting an external load to dio pins the pb pin is a dedicated digital input. in addition, if the opt ical uart is not used, opt_ tx and opt_rx can be configured as dedicated dio pins dio1 and dio2. thus, in addition to the 12 general-purpose dio pins (dio4dio11, dio14dio17), there are three additional pins that can be used for digital input and output. dio1 v3p3d 71m6521b v3p3sys dgnd vbat 3.3v recommended r led dio1 v3p3d 71m6521b v3p3sys dgnd vbat 3.3v downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 41 of 97 the control resources selectable for the dio pins are listed in table 55 . if more than one input is connected to the same resource, the resources are combined using a logical or. dio_r value resource selected for dio pin 0 none 1 reserved 2 t0 (counter0 clock) 3 t1 (counter1 clock) 4 high priority i/o interrupt (int0 rising) 5 low priority i/o interrupt (int1 rising) 6 high priority i/o interrupt (int0 falling) 7 low priority i/o interrupt (int1 falling) table 55: selectable controls using the dio_dir bits lcd drivers the device contains 20 dedicated lcd segment drivers in addition to the 15 mult i-use pins described abov e. thus, the device is capable of driving between 80 to 140 pixels of lcd display with 25% duty cycle (or 60 to 105 pixels with 33% duty cycle). a t eight pixels per digit, this corresponds to 10 to 17 digits. the lcd drivers are grouped into 4 commons and 35 segment drivers. the lcd interface is flexible and can drive either digit segments or enunciator symbols. segment drivers seg18 and seg19 can be configured to blink at either 0.5hz or 1hz. the blink rate is controlled by lcd_y . there can be up to four pixels/segments connected to each of these drivers. lcd_blkmap18[3:0] and lcd_blkmap19[3:0] identify which pixels, if any, are to blink. lcd interface memory is powered by the non-volatile supply. the bits of the lcd memory are preserved in lcd and sleep modes, even if their pin is not configured as seg. in this case, they can be useful as general- purpose non-volatile storage. battery monitor the battery voltage is measured by the a dc during alternative mux frames if the bme (battery measure enable) bit is set. while bme is set, an on-chip 45k load resistor is applied to the battery and a scaled fraction of the battery voltage is applied to the adc input. after each alternative mu x frame, the result of t he adc conversion is availabl e at ce dram address 0x07. bme is ignored and assumed zero when system pow er is not available. see the battery monitor section of the electrical specification section for deta ils regarding the adc lsb size and the conversion accuracy. eeprom interface the 71m6521be provides hardware support for ei ther type of eeprom interface, a two-pi n interface and a three-pin interface. the interfaces use the eectrl and eedata registers for communication. two-pin eeprom interface the dedicated 2-pin serial interface communicates with exter nal eeprom devices. the interface is multiplexed onto dio4 (sck) and dio5 (sda) controlled by the dio_eex bit (see i/o ram table). the mpu communicates with the interface through two sfr registers: eedata and eectrl . if the mpu wishes to write a byte of data to eeprom, it places the data in eedata and then writes the transmit command (cmd = 0011) to eectrl . the write to eectrl initiates the transmit operation. the transmit operat ion is finished when the busy bit falls. int5 is also asserted when busy falls. the mpu can then check the rx_ack bit to see if the eeprom acknowledged the transmission. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 42 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 a byte is read by writing the receive command (cmd = 0001) to eectrl and waiting for the busy bit to fall. upon comple- tion, the received data is in eedata . the serial transmit and receive clock is 78k hz during each transmission, and the clock is held in a high state until the nex t transmission. the bits in eectrl are shown in table 56 . the eeprom interface can also be operated by c ontrolling the dio4 and dio5 pins directly. however, controlling dio4 and dio5 directly is discouraged, because it may tie up the mpu to the point where it may become too busy to process interrupts . status bit name read/ write reset state polarity description 7 error r 0 positive 1 when an illegal command is received. 6 busy r 0 positive 1 when serial data bus is busy. 5 rx_ack r 1 negative 0 indicates that the eeprom sent an ack bit. 4 tx_ack r 1 negative 0 indicates when an ack bit has been sent to the eeprom 3-0 cmd[3:0] w 0000 positive, see cmd table cmd operation 0000 no-op. applying the no- op command will stop the i 2 c clock (sck, dio4). failure to issue the no-op command will keep the sck signal toggling. 0010 receive a byte from eeprom and send ack. 0011 transmit a byte to eeprom. 0101 issue a stop sequence. 0110 receive the last byte fr om eeprom and do not send ack. 1001 issue a start sequence. others no operation, set the error bit. table 56: eectrl status bits three-wire eeprom interface a 500khz three-wire interface, using sdata, sck, and a dio pi n for cs is available. the interface is selected with dio_eex =3. the same 2-wire eectrl register is used, except the bi ts are reconfigured, as shown in table 57 . when eectrl is written, up to 8 bits from eedata are either written to the eeprom or r ead from the eeprom, depending on the values of the eectrl bits.the timing diagrams in figure 9 through figure 13 describe the 3-wire eeprom interface behavior. all commands begin when the eectrl register is written. transactions start by fi rst raising the dio pin that is connected to cs. multiple 8-bit or less commands such as those shown in figure 9 through figure 13 are then sent via eectrl and eedata . when the transaction is finished, cs must be lowered. at the end of a read transac tion, the eeprom will be driving sdata, but will transition to hiz (high impedance) when cs falls. the firmware should then immediatel y issue a write command with cnt=0 and hiz=0 to take control of sd ata and force it to a low-z state. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 43 of 97 control bit name read/write description 7 wfr w wait for ready. if this bit is set, the trailing edge of busy will be delayed until a rising edge is seen on the data line. this bit can be used during the last byte of a write command to cause the int5 interrupt to occur when the eeprom has finished its internal writ e sequence. this bit is ignored if hiz=0. 6 busy r asserted while serial data bus is busy. when the busy bit falls, an int5 interrupt occurs. 5 hiz w indicates that the sd signal is to be floated to high impedance immediately after the last sck rising edge. 4 rd w indicates that eedata is to be filled with data from eeprom. 3-0 cnt [3:0] w specifies the number of clocks to be i ssued. allowed values are 0 through 8. if rd=1, cnt bits of data will be read msb first, and right justified into the low order bits of eedata . if rd=0, cnt bits will be sent msb first to eeprom, shifted out of eedatas msb. if cnt is zero, sdata will simply obey the hiz bit. table 57: eectrl bits for 3-wire interface sclk (output) busy (bit) cnt cycles (6 shown) sdata (output) write -- no hiz d2 d3 d4 d5 d6 d7 eectrl byte written int5 sdata output z (loz) figure 9: 3-wire interface. write command, hiz=0. cnt cycles (6 shown) write -- with hiz int5 eectrl byte written sclk (output) busy (bit) sdata (output) d2 d3 d4 d5 d6 d7 (hiz) (loz) sdata output z figure 10: 3-wire interface. write command, hiz=1 downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 44 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 cnt cycles (8 shown) read d0 d1 d2 d3 d4 d5 int5 d6 d7 eectrl byte written sclk (output) busy (bit) sdata (input) sdata output z (hiz) figure 11: 3-wire interface. read command. cnt cycles (0 shown) write -- no hiz d7 int5 not issued cnt cycles (0 shown) write -- hiz int5 not issued eectrl byte written eectrl byte written sclk (output) busy (bit) sdata (output) sclk (output) busy (bit) sdata (output) (hiz) sdata output z sdata output z (loz) figure 12: 3-wire interface. write command when cnt=0 cnt cycles (6 shown) write -- with hiz and wfr eectrl byte written sclk (output) busy (bit) sdata (out/in) d2 d3 d4 d5 d6 d7 busy ready (from eeprom) int5 (from 6520) sdata output z (hiz) (loz) figure 13: 3-wire interface. write command when hiz=1 and wfr=1. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 45 of 97 hardware watchdog timer re watchdog timer in addition to the basic watchdog timer included in the 80515 mpu, an independent, robust, fixed-duration, watchdog timer (wdt) is included in the device. it uses the crystal oscillator as its time base and must be refres hed by the mpu firmware at least every 1.5 seconds. when not refreshed on time the wdt ov erflows, and the part is reset as if the reset pin were pulled high, except that the i/o ram bits will be in the same state as after a wake-up from sleep or lcd modes (see the i/o ram description for a list of i/o ram bit states after reset and wake-up). 4100 o scillator cycles (or 125ms) after the wdt overflow, the mpu will be launc hed from program address 0x0000. v3p3 v3p3 - 400mv v3p3 - 10mv vbias 0v battery modes normal operation, wdt enabled wdt dis- abled v1 a status bit, wd_ovf , is set when wdt overflow occurs. this bit is powered by the nonvolatile supply and can be read by the mpu when wake rises to determine if the part is initializing after a wd overflow event or a fter a power-up. after it is read, mpu firmware must clear wd_ovf . the wd_ovf bit is cleared by the reset pin there is no internal digital state that deactivates the wdt. for debug purposes, however, the wdt can be disabled by tying the v1 pin to v3p3 (see figure 35 ). of course, this also deactivates v1 power fault detection. since ther e is no firmware way to disable the crystal oscillator or the wdt, it is guaranteed that whatever state the part might find itself in, upon watchdog overflow, the part will be reset to a known state. asserting ice_e will also deactivate the wdt. this is the only method that will work in brownout mode. in normal operation, the wdt is reset by periodically writing a one to the wdt_rst bit. the watchdog timer is also reset when the inter nal signal wake=0 (see section on wake up behavior). figure 14: functions defined by v1. program security when enabled, the security feature limits the ice to global flash erase operations only. all other ice operations are blocked. this guarantees the security of the users mpu and ce program code. security is enabled by mpu code that is executed in a 32 cycle preboot interval before the primary boot sequence begins. once security is enabled, the only way to disable it is to perform a global erase of the flash, followed by a chip reset. the first 32 cycles of the mpu boot code are called the preboot phase bec ause during this phase the ic e is inhibited. a read- only status bit, preboot , identifies these cycles to the mpu. upon completion of preboot, the ice can be enabled and is permitted to take control of the mpu. secure , the security enable bit, is reset whenever the chip is rese t. hardware associated with the bit permits only ones to be written to it. thus, preboot code may set secure to enable the security feature but may not reset it. once secure is set, the preboot code is protected and no external read of program code is possible specifically, when secure is set: ? the ice is limited to bulk flash erase only. ? page zero of flash memory, the preferred location for the users preboot code, may not be page-erased by either mpu or ice. page zero may only be erased with global flash erase. ? writes to page zero, whether by mpu or ice are inhibited. the secure bit is to be used with caution! inadvertently setting this bit will i nhibit access to the part via the ice interface, if no mechanism for actively resetting the part between reset and erase operat ions is provided (see ice interface description). downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 46 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 test ports tmuxout pin: one out of 16 digital or 8 analog signals can be select ed to be output on the tmuxou t pin. the function of the multiplexer is controlled with the i/o ram register tmux (0x20aa[4:0]), as shown in table 58 . tmux [4:0] mode function 0 analog dgnd 1 analog reserved 2 analog dgnd 3-5 analog reserved 6 analog vbias 7 analog not used 8-0x0f -- reserved 0x10 C 0x13 -- not used 0x14 digital rtm (real time output from ce) 0x15 digital wdtr_en (comparat or 1 output and v1lt3) 0x16 C 0x17 not used 0x18 digital rxd (from optical inte rface, w/ optional inversion) 0x19 digital mux_sync 0x1a digital ck_10m 0x1b digital ck_mpu 0x1c -- reserved 0x1e digital ce_busy 0x1f digital xfer_busy table 58: tmux [4:0] selections downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 47 of 97 functional description theory of operation the energy delivered by a power source into a load can be expressed as: = t dt tit v e 0 )( )( assuming phase angles are constant, the following formulae apply: p = real energy [wh] = v * a * cos * t q = reactive energy [varh] = v * a * sin * t s = apparent energy [vah] = 2 2 q p + for a practical meter, not only volt age and current amplitudes, but also phas e angles and harmonic content may change constantly. thus, simple rms measurements are inherently inaccurate. a modern solid-sta te electricity meter ic such as the teridian 71m6521be functions by emulati ng the integral operation abov e, i.e. it processes current and voltage samples through an adc at a constant frequency. as long as the adc resolution is high enough and the sample frequency is beyond the harmonic range of interest, the current and voltage samples, multiplied with t he time period of sampling will yield an accurate quantity for the momentary energy. summing up the momentary energy quantities over time will result in accumulated energy. -500 -400 -300 -200 -100 0 100 200 300 400 500 0 5 10 15 20 current [a] voltage [v] energy per interval [ws] accumulated energy [ws] figure 15: voltage. current, momentary and accumulated energy figure 15 shows the shapes of v(t), i(t), the momentary power and the accu mulated energy, resulting from 50 samples of the voltage and current signals over a period of 20ms. the application of 240vac and 100a results in an accumulation of 480ws (= 0.133wh) over the 20ms period, as indi cated by the accumulated energy curve. the described sampling method works reliably, even in the presence of dynamic phase sh ift and harmonic distortion. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 48 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 system timing summary figure 16 summarizes the timing relationships between the input mu x states, the ce_busy signal , and the two serial output streams. in this example, mux_div =4 and fir_len =1 (384). the duration of each mu x frame is 1 + mux_div * 2 if fir_len =288, and 1 + mux_div * 3 if fir_len =384. an adc conversion will always consume an integer number of ck32 clocks. followed by the conversions is a single ck32 cycl e where the bandgap voltage is allow ed to recover from the change in cross. each ce program pass begins when adc0 (channel ia) conver sion begins. depending on the lengt h of the ce program, it may continue running until the end of the adc3 (vb) conversion. ce opcodes are constructed to ensure that all ce code passes consume exactly the same number of cycles. the result of each adc conversion is in serted into the ce dram when the conversion is complete. the ce is written to tolerate sudden changes in adc data. t he exact ck count when each adc value is loaded into dram is shown in figure 16 . figure 16 also shows that the serial rtm data stream begins transmitting at the beginning of state s. rtm, consisting of 140 ck cycles, will always finish before the next code pass starts. ck32 mux state 0 mux_div conversions, mux_div =1 (4 conversions) is shown settle adc mux frame adc execution s mux_sync s ce_execution rtm 140 max ck count 0 450 150 900 1350 1800 adc0 adc1 adc2 adc3 ck count = ce_cycles + floor((ce_cycles + 2) / 5) notes: 1. all dimensions are 5mhz ck counts. 2. the precise frequency of ck is 150*crystal frequency = 4.9152mhz. 3. xfer_busy occurs once every (presamps * sum_cycles) code p asses. ce_busy xfer_busy initiated by a ce opcode at end of sum interval adc timing ce timing rtm timing 123 figure 16: timing relationship between adc mux, compute engine, and serial transfers. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 49 of 97 cktest tmuxout/rtm flag rtm data0 (32 bi ts) ls b s i g n l s b s i g n rtm data1 (32 bi ts) l s b l s b s i g n s i g n rtm data2 (32 bi ts) rtm data3 (32 bi ts) 01 30 31 01 30 31 01 30 31 01 30 31 flag flag flag mux_sync ck32 figure 17: rtm output format battery modes shortly after system power (v3p3sys) is applied, the part w ill be in mission mode. mission mode means that the part is operating with system power and that the internal pll is st able. this mode is the normal operation mode where the part is capable of measuring energy. when system power is not available (i.e. when v1 71m6521be energy meter ic data sheet january 2008 page: 50 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 brownout mode in brownout mode, most non-metering digital functions, as shown in table 59 , are active, including ice, uart, eeprom, and lcd. in brownout mode, a low bias current regulator will provi de 2.5 volts to v2p5 and the nonvolatile v2p5 net. the regulator has an output called bat_ok to indicate that it has sufficient over head. when bat_ok = 0, the part will enter sleep mode. the v3p3d output pin is active in brownout mode, and low-current exter nal components, such as eeproms can be supplied with the current from this pin while the chip is in brownout mode. from brownout mode, the processor can voluntarily enter lcd or sleep modes. w hen system power is restored, the part will automatically transition from any of the battery modes to missi on mode, once the pll has settled. the mpu will run at crystal clock rate in brownout mode. the value of mpu_div will be remembered (not changed) as the part enters and exits brownout. while pll_ok = 0, the i/o ram bits adc_e and ce_e are held in zero state disabling both adc and ce. when pll_ok falls, the ce program counter is cleared immediately and all fir processing halts. fi gure 19 shows the functional blocks active in brownout mode. v3p3sys rises v3p3sys falls mission brownout lcd sleep or v1 > vbias v1 <= vbias lcd_only reset & vbat_ok reset ie_pllrise -> 1 ie_pllfall -> 1 ie_pb -> 1 ie_wake -> 1 pb timer timer pb reset & v3p3sys rises v3p3sys rises vbat_ok vbat_ok vbat_ok vbat_ok sleep figure 18: operation modes state diagram downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 51 of 97 lcd mode in lcd mode, the dat a contained in the lcd_seg registers is displayed, i.e. up to f our lcd segments connec ted to each of the pins seg18 and seg19 can be made to blink wi thout the involvement of the mpu, which is disabled in lcd mode. the v3p3d output pin is inactive in lcd mode. this mode can be exited only by system power up, a timeout of the wake-up ti mer, or a push button. figure 20 shows the functional blocks active in lcd mode. sleep mode in sleep mode, the battery current is minimized and only the osc illator is active. the v3p3d output pin is inactive in lcd mode. this mode can be exited only by sy stem power-up, a timeout of the wa ke-up timer, or a push button event. figure 21 shows the functional blocks active in sleep mode. system power battery power (nonvolatile supply) circuit function mission brownout lcd sleep ce yes -- -- -- ce data ram yes yes -- -- fir yes -- -- -- analog circuits: pll, adc, vref, bme, etc. yes -- -- -- mpu clock rate 4.92mhz (from pll) 28.672khz (7/8 of 32768hz) -- -- mpu_div yes yes -- -- ice yes yes -- -- dio pins yes yes -- -- watchdog timer yes yes -- -- lcd yes yes yes -- eeprom interface (2-wire) yes yes (8kb/s) -- -- eeprom interface (3-wire) yes yes (16kb/s) -- -- uart yes yes -- -- optical tx modulation yes -- -- -- flash read yes yes -- -- flash page erase yes yes -- -- flash write yes -- -- -- ram read and write yes yes -- -- wakeup timer yes yes yes yes crystal oscillator yes yes yes yes dram data preservation yes yes -- -- v3p3d voltage output yes yes -- -- table 59: available circuit functions ( means not active) downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 52 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 ia va mux xin xout vref ckadc cktest/ seg19 ce 32 bit compute engine mpu (80515) ce control opt_rx/ dio1 opt_tx/ dio2/ wpulse/ varpulse reset vbias v1 emulator port ce_busy optical uart tx rx xfer busy com0..3 vlc2 lcd display driver data 00-7f prog 000-7ff data 0000-ffff prog 0000-1fff 0000- 1fff mpu xram (2kb) 0000-07ff digital i/o config (i/o ram) 2000-20ff i/o ram ce ram (0.5kb) memory share 1000-11ff 32khz mux_sync ckce ckmpu ck32 ce_e rtm_e comp_stat power fault lcd_e lcd_clk lcd_mode dio 4.9mhz <4.9mhz 4.9mhz gndd v3p3a v3p3d vbat volt reg 2.5v to logic v2p5 mpu_div sum_cycles pre_samps equ ckout_e 32khz tmuxout mpu_rstz faultz wake tmux[4:0] configuration parameters gnda vbias february 2, 2007 cross ck_gen osc (32khz) ck32 ckout_e mck pll vref vref_dis div adc mux ctrl mux_div chop_e equ strt ib mux mux ckfir 4.9mhz rtm seg34/dio14 .. seg37/dio17 wpulse varpulse wpulse varpulse test test mode lcd_mode vlc1 vlc0 lcd_e <4.9mhz lcd_num dio_r dio_dir lcd_num dio_pv/pw mux_alt seg24/dio4 .. seg31/dio11 sdck sdout sdin e_rxtx/seg38 e_tclk/seg33 e_rst/seg32 flash (8kb) flsh66zt v3p3a fir_len fir seg0..18 eeprom interface dio_eex ck_2x eck_dis opt_txe v3p3d lcd_gen x4mhz pb vb vbias memory share seg32,33 seg19,38 e_rxtx e_tclk e_rst (open drain) ice_e dio1,2 vref_cal ? adc converter + - vref adc_e rtm_0..3 ce_lctn pls_maxwidth pls_interval pls_inv opt_txinv opt_rxinv opt_rxdis lcd_blkmap lcd_seg lcd_y sleep lcd_only v3p3sys test mux v3p3d temp vbat vbat mod opt_txmod opt_fdc ce_lctn figure 19: functional blocks in brownout mode (inactive blocks grayed out) downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 53 of 97 ia va mux xin xout vref ckadc cktest/ seg19 ce 32 bit compute engine mpu (80515) ce control opt_rx/ dio1 opt_tx/ dio2/ wpulse/ varpulse reset vbias v1 emulator port ce_busy optical uart tx rx xfer busy com0..3 vlc2 lcd display driver data 00-7f prog 000-1ff data 0000-ffff prog 0000-1fff 0000- 1fff mpu xram (2kb) 0000-07ff digital i/o config (i/o ram) 2000-20ff i/o ram ce ram (0.5kb) memory share 1000-11ff 32khz mux_sync ckce ckmpu ck32 ce_e rtm_e comp_stat power fault lcd_e lcd_clk lcd_mode dio 4.9mhz <4.9mhz 4.9mhz gndd v3p3a v3p3d vbat volt reg 2.5v to logic v2p5 mpu_div sum_cycles pre_samps equ ckout_e 32khz tmuxout mpu_rstz faultz wake tmux[4:0] configuration parameters gnda vbias february 2, 2007 cross ck_gen osc (32khz) ck32 ckout_e mck pll vref vref_dis div adc mux ctrl mux_div chop_e equ strt ib mux mux ckfir 4.9mhz rtm seg34/dio14 .. seg37/dio17 wpulse varpulse wpulse varpulse test test mode lcd_mode vlc1 vlc0 lcd_e <4.9mhz lcd_num dio_r dio_dir lcd_num dio_pv/pw mux_alt seg24/dio4 .. seg31/dio11 sdck sdout sdin e_rxtx/seg38 e_tclk/seg33 e_rst/seg32 flash (8kb) flsh66zt v3p3a fir_len fir seg0..18 eeprom interface dio_eex ck_2x eck_dis opt_txe v3p3d lcd_gen x4mhz pb vb vbias memory share seg32,33 seg19,38 e_rxtx e_tclk e_rst (open drain) ice_e dio1,2 vref_cal ? adc converter + - vref adc_e rtm_0..3 ce_lctn pls_maxwidth pls_interval pls_inv opt_txinv opt_rxinv opt_rxdis lcd_blkmap lcd_seg lcd_y sleep lcd_only v3p3sys test mux v3p3d temp vbat vbat mod opt_txmod opt_fdc figure 20: functional blocks in lcd m ode (inactive blocks grayed out) downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 54 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 ia va mux xin xout vref ckadc cktest/ seg19 ce 32 bit compute engine mpu (80515) ce control opt_rx/ dio1 opt_tx/ dio2/ wpulse/ varpulse reset vbias v1 emulator port ce_busy optical uart tx rx xfer busy com0..3 vlc2 lcd display driver data 00-7f prog 000-1ff data 0000-ffff prog 0000-1fff 0000- 1fff mpu xram (2kb) 0000-07ff digital i/o config (i/o ram) 2000-20ff i/o ram ce ram (0.5kb) memory share 1000-11ff 32khz mux_sync ckce ckmpu ck32 ce_e rtm_e comp_stat power fault lcd_e lcd_clk lcd_mode dio 4.9mhz <4.9mhz 4.9mhz gndd v3p3a v3p3d vbat volt reg 2.5v to logic v2p5 mpu_div sum_cycles pre_samps equ ckout_e 32khz tmuxout mpu_rstz faultz wake tmux[4:0] configuration parameters gnda vbias february 2, 2007 cross ck_gen osc (32khz) ck32 ckout_e mck pll vref vref_dis div adc mux ctrl mux_div chop_e equ strt ib mux mux ckfir 4.9mhz rtm seg34/dio14 .. seg37/dio17 wpulse varpulse wpulse varpulse test test mode lcd_mode vlc1 vlc0 lcd_e <4.9mhz lcd_num dio_r dio_dir lcd_num dio_pv/pw mux_alt seg24/dio4 .. seg31/dio11 sdck sdout sdin e_rxtx/seg38 e_tclk/seg33 e_rst/seg32 flash (8kb) flsh66zt v3p3a fir_len fir seg0..18 eeprom interface dio_eex ck_2x eck_dis opt_txe v3p3d lcd_gen x4mhz pb vb vbias memory share seg32,33 seg19,38 e_rxtx e_tclk e_rst (open drain) ice_e dio1,2 vref_cal ? adc converter + - vref adc_e rtm_0..3 ce_lctn pls_maxwidth pls_interval pls_inv opt_txinv opt_rxinv opt_rxdis lcd_blkmap lcd_seg lcd_y sleep lcd_only v3p3sys test mux v3p3d temp vbat vbat mod opt_txmod opt_fdc figure 21: functional blocks in sleep m ode (inactive blocks grayed out) downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 55 of 97 time system power (v3p3sys) mpu mode battery current transition mpu clock source xtal pll (4.2mhz/mux_div) pll_ok mission 2048...4096 ck32 cycles 300na 13..14 ck cycles wake brownout v1_ok figure 22: transition from brownout to mi ssion mode when system power returns time v3p3sys and vbat mpu mode battery current mpu clock source xtal pll (4.2mhz) pll_ok mission 300na wake internal resetz brown- out 1024 ck32 cycles 14.5 ck32 cycles 4096 ck32 cycles v1_ok figure 23: power-up timing with v3p3sys and vbat tied together downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 56 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 time vbat mpu mode battery current mpu clock source xtal pll_ok wake internal resetz 1024 ck32 cycles brownout 14.5 ck32 cycles vbat_ok figure 24: power-up timing with vbat only fault and reset behavior reset mode: when the reset pin is pulled high all digital activity st ops. the oscillator module continues to run. additionally, all i/o ram bits are set to their default states. as long as v1, the input voltage at the power fault block, is greater than vb ias, the internal 2.5v regulator will continue to provide power to the digital section. once initiated, the reset mode will persi st until the reset timer times out, signifi ed by wake rising. this will occur in 4100 cycles of the real time clock after reset goes low, at wh ich time the mpu will begin exec uting its preboot and boot sequences from address 00. see the security secti on for more description of preboot and boot. if system power is not present, the reset timer duration will be 2 cycles of the crystal clock, at which time the mpu will begi n executing in brownout m ode, starting at address 00. power fault circuit: the 71m6521be includes a comparator to monitor sy stem power fault conditi ons. when the output of the comparator falls (v1 71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 57 of 97 if there is no battery when system power returns, the part will switch to mission mode when pll_o k rises. all configuration bits will be in reset state, and mpu ram data w ill be unknown and must be in itialized by the mpu. wake up behavior as described above, the part will always wake up in mission m ode when system power is restor ed. additionally, the part will wake up in brownout mode when pb rises (push button pre ssed) or when a timeout of the wake-up timer occurs. wake on pb if the part is in sleep or lcd mode, it can be awakened by a rising edge on the pb pin. this pin is normally pulled to gnd and can be pulled high by a push button depression. before the pb signal rises, the mpu is in reset due to wake being low. when pb rises, wake rises and within three crystal cycles, t he mpu begins to execute. the mpu can determine whether the pb signal woke it up by checking the ie_pb flag. for debouncing, the pb pin is monitored by a state machine operating from a 32hz clo ck. this circuit will reject between 31ms and 62ms of noise. detection hardware will i gnore all transitions after the initial rising edge. this will continue until the m pu clears the ie_pb bit. time system power (v3p3sys) mpu mode pll_ok 15 ck32 cycles wake lcd pb or wake- up timer brownout figure 25: wake up timing wake on timer if the part is in sleep or lcd mode, it c an be awakened by the wake-up timer. until this timer times out, the mpu is in reset due to wake being low. when the wake-up timer times out, the wake signal rises and within three crystal cycles, the mpu begins to execute. the mpu can determine w hether the timer woke it by checking the autowake interrupt flag ( ie_wake ). the wake-up timer begins timing when the part enters l cd or sleep mode. its duration is controlled by wake_prd[2:0] and wake_res . wake_res selects a timer lsb of either 1 minute ( wake_res =1) or 2.5 seconds ( wake_res =0). wake_prd[2:0] selects a duration of from 1 to 7 lsbs. the timer is armed by wake_arm =1. it must be armed at least three crystal clock cycles before sleep or lcd_only is initiated. setting wake_arm presets the timer with the values in wake_res and wake_prd and readies the timer to start when the processor writes to sleep or lcd_only . the timer is reset and disarmed whenever the processor is awake. thus, if it is desired to wake the mpu periodically (every 5 seconds, fo r example) the timer must be r earmed every time the mpu is awakened. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 58 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 data flow the data flow between ce and mpu is shown in figure 26 . in a typical application, t he 32-bit compute engine (ce) sequen- tially processes the samples from the voltage inputs on pins ia, va, ib, and vb, per forming calculations to measure active power (wh). these measurements are then accessed by the mpu, processed further and output using the peripheral devices available to the mpu. ce mpu pre- processor post- processor irq processed metering data pulse i/o ram (configuration ram) samples data figure 26: mpu/ce data flow ce/mpu communication figure 27 shows the functional relationship betw een ce and mpu. the ce is controlled by the mpu via shared registers in the i/o ram and by registers in the ce dram. the ce outputs two interrupt signals to the mpu: ce_busy and xfer_busy, which are connected to the mpu interrupt service inputs as external interrupts. ce_b usy indicates that the ce is actively processing data. this signal will occur once every multiplexer cycle. xfer_busy indica tes that the ce is updating data to the output region of the ce dram. this will occur whenever the ce has fini shed generating a sum by completing an accumulation interval determined by sum_cycles * pre_samps samples. interrupts to the mpu occur on the falling edges of the xfer_busy and ce_busy signals. mpu ce wpulse interrupts display (me- mory-mapped lcd segments) dio eeprom (i2c) serial (uart0/1) samples (dio6) wsum adc ce_busy xfer_busy mux ctrl. data sag control i/o ram (configuration ram) figure 27: mpu/ce communication downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 59 of 97 temperature measurement measurement of absolute tem perature uses the on-chip temperature sensor while applying the following formula: n n n t s n t n t + ? = ) )( ( in the above formula t is the temperature in c, n(t) is the adc count at temperature t, n n is the adc count at 25c, s n is the sensitivity in lsb/c as stated in the electr ical specifications, and t n is +25c. example: at 25c a temperature s ensor value of 518,203,584 (n n ) is read by the adc. at an unknown temperature t the value 449.648.000 is read at (n(t)). the absolute temperature is then determined by dividing both n n and n(t) by 512 to account for the 9-bit shift of the adc value and then insert ing the results into the above formula, using C2220 for lsb/c: c c t = + ?? = 3.85 25 ) 2220 ( 512 4 518,203,58 -0 449.648.00 it is recommended to base te mperature measurements on temp_raw_x which is the sum of tw o consecutive temperature readings thus being higher by a factor of two than the raw sensor readings. temperature compensation temperature coefficients: the internal voltage reference is calibrated during device manufacture. the temperature coefficients tc1 and tc2 are given as constants t hat represent typical co mponent behavior (in v/c and v/c 2 , respectively). since tc1 and tc2 are given in v/c and v/c 2 , respectively, the value of t he vref voltage (1.195v) has to be taken into account when transitioning to ppm/c and ppm/c 2 . this means that ppm c = 26.84*tc1/1.195, and ppmc2 = 1374*tc2/1.195). temperature compensation : the ce provides the bandgap temperature to t he mpu, which then may digitally compensate the power outputs for the te mperature dependence of vref, using the ce register gain_adj . since the band gap amplifier is chopper-stabilized via the chop_en bits, the most significant long-term drift me chanism in the voltage reference is removed. the mpu, not the ce, is entirel y in charge of providing tem perature compensation. the mpu applies the following formula to determine gain_adj (address 0x12) . in this formula temp_x is the deviation from nominal or calibration temperature expressed in multiples of 0.1c: 23 2 14 2 2 _ 2 _ 16385 _ ppmc x temp ppmc x temp adj gain ? + ? + = in a production electricity meter, the 71m6521be is not the only co mponent contributing to te mperature dependency. a whole range of components (e.g. current transformers, resistor dividers, power sources, filt er capacitors) will contribute temperatur e effects. since the output of the on-chip temperature sensor is accessible to the mpu, temperature- compensation mechanisms with great flexibility are possible. mpu access to gain_adj permits a system-wide tem perature correction over the entire meter rather than local to the chip. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 60 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 application information connection of sensors (ct, resistive shunt) figure 28 and figure 29 show how resistive dividers, current transforme rs, and restive shunts are connected to the voltage and current inputs of the 71m6521be. vout = r * i out = r * i in /n va = vin * r out /(r out + r in ) v in r in r out va figure 28: resistive voltage divider (left), current transformer (right) vout = r * i in v out r i in i in ia v3p3 figure 29: resistive shunt connecting 5v devices all digital input pins of the 71m6521be are compatible with external 5v devices. i/o pins configured as inputs do not require current-limiting resistors when they are connected to external 5v devices. see the cautionary note on the restrictions for combined seg/dio pins c onfigured as digital inputs in the digital i/o section. v out r 1/n i in i out core i in i out v3p3 ia filter downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 61 of 97 connecting lcds the 71m6521be has a lcd controller on-chip capable of controlling static or multiplexed lcds. figure 30 shows the basic connection for a lcd. segments 6521 lcd commons figure 30: connecting lcds nineteen pins are dedicated lcd segment pins (seg0 to seg18). if more pi ns are needed to drive segments, the dual- function pins cktest/seg19, e_rxtx/seg38, e_tclk/seg33, and e_rst/seg32 can be used. even more segment pins are available in the form of combined dio and segment pins (seg24/dio4 to seg31/dio11, seg34/dio14 to seg37/dio17). the split between dio and lcd use of the combined pins is controlled with the dio register lcd_num . lcd_num can be assigned any number between 0 and 18. the fi rst dual-purpose pin to be allocated as lcd is seg37/dio17. thus if lcd_num =5, seg37 will be configured as lcd. the remaining seg36 to seg24 will be configured as dio16 to dio4. dio1 and dio2 are always available, if not used for the optical port. pins cktest/seg19, e_rxtx/seg38, e_tclk /seg33, and e_rst/seg32 are not affected by lcd_num . downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 62 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 lcd_num seg in addition to seg0-seg19 total number of lcd segment pins in- cluding seg0-seg19 dio pins in addition to dio1-dio2 total number of dio pins including dio1, dio2 0 - 19 4-11, 14-17 14 1 - 19 4-11, 14-17 14 2 - 19 4-11, 14-17 14 3 - 19 4-11, 14-17 14 4 - 19 4-11, 14-17 14 5 37 20 4-11, 14-16 13 6 36-37 21 4-11, 14-15 12 7 35-37 22 4-11, 14 11 8 34-37 23 4-11 10 9 34-37 23 4-11 10 10 34-37 23 4-11 10 11 31, 34-37 24 4-10 9 12 30-31, 34-37 25 4-9 8 13 29-31, 34-37 26 4-8 7 14 28-31, 34-37 27 4-7 6 15 27-31, 34-37 28 4-6 5 16 26-31, 34-37 29 4-5 4 17 25-31, 34-37 30 4 3 18 24-31, 34-37 31 none 2 lcd segment numbers are given without cktest/seg19, e_rx tx/seg38, e_tclk/seg33, and e_rst/seg32. table 60: lcd and dio pin assignment by lcd_num downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 63 of 97 connecting i 2 c eeproms i 2 c eeproms or other i 2 c compatible devices should be connected to the dio pins dio4 and dio5, as shown in figure 31 . pull-up resistors of roughly 10k to v3p3d (to ensure operation in browno ut mode) should be used for both scl and sda signals. the dio_eex register in i/o ram must be set to 01 in order to convert the dio pins dio4 and dio5 to i 2 c pins scl and sda. dio4 dio5 6521b eeprom scl sda v3p3d 10k ? dio4 dio5 6521b eeprom scl sda v3p3d 10k ? figure 31: i 2 c eeprom connection connecting three-wire eeproms wire eeproms and other compatible dev ices should be connected to the dio pins dio4 and dio5, as shown in figure 32 . dio5 connects to both the di and do pins of the three-wire device. the cs pin must be connected to a vacant dio pin of the 71m6521be. a pull-up resistor of roughly 10k to v3p3d (to ensure operation in br ownout mode) should be used for the di/do signals, and the cs pin should be pulled down with a resistor to prevent that the three-wi re device is selected on power- up, before the 71m6521be can establish a stable signal for cs. the dio_eex register in i/o ram must be set to 10 in order to convert the dio pins dio4 and dio5 to uwire pins. the pull-up resistor for dio5 may not be necessary. 10k ? dio4 dio5 6521b eeprom sclk di v3p3d 10k ? cs dion do 10k ? 10k ? dio4 dio5 6521b eeprom sclk di v3p3d 10k ? cs dion do 10k ? figure 32: three-wire eeprom connection downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 64 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 uart0 (tx/rx) the rx pin should be pulled down by a 10k resistor and additionally protected by a 100pf ceramic capacitor, as shown in figure 33 . tx rx 71m6521be 10k ? 100pf 71m6521be rx tx tx rx 10k ? 100pf rx tx figure 33: connections for the rx pin optical interface the pins opt_tx and opt_rx can be used for a regular serial interface, e.g. by connecting a rs-232 transceiver, or they can be used to directly operate optical co mponents, e.g. an infrared di ode and phototransistor implement ing a flag interface. figure 34 shows the basic connections. the opt_tx pi n becomes active when the i/o ram register opt_txdis is set to 0. the polarity of the opt_tx and opt_rx pins can be inverted with configuration bits opt_txinv and opt_rxinv , re- spectively. the opt_tx output may be modulated at 38k hz when system power is present. modul ation is not available in brownout mode. the opt_txmod bit enables modulation. the duty cycle is controlled by opt_fdc[1:0] , which can select 50%, 25%, 12.5%, and 6.25% duty cycle. a 6.25% duty cycle m eans opt_tx is low for 6.25% of the period. the receive pin (opt_rx) may need an analog filt er when receiving modulated optical signals. with modulation, an optical emitter c an be operated at higher current than nominal, enabling it to increase the distance along the optical path. if operation in brownout mode is desired, the ex ternal components should be connected to v3p3d. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 65 of 97 opt_tx opt_rx r 2 r 1 v3p3sys 71m6521be v3p3sys phototransistor led 10k ? 100pf opt_tx opt_rx r 2 r 1 v3p3sys 71m6521be 10k ? 100pf v3p3sys phototransistor led figure 34: connection for optical components connecting v1 and reset pins a voltage divider should be used to establish that v1 is in a safe range when the me ter is in mission mode (v1 must be lower than 2.9v in all cases in order to keep the hardware watchdog timer enabled). fo r proper debugging or loading code into the 71m6521be mounted on a pcb, it is necessary to hav e a provision like the header shown above r1 in figure 35 . a shorting jumper on this header pulls v1 up to v3p3 disabling the hardware watchdog timer. the parallel impedance of r1 and r2 should be approximately 20 to 30k in order to provide hyst eresis for the power fault monitor. v3p3 r 2 r 1 v1 r 3 5k ? c 1 100pf gnd v3p3 r 2 r 1 r 3 5k ? v1 c 1 100pf gnd figure 35: voltage divider for v1 even though a functional meter will not necessarily need a reset swit ch, it is useful to have a reset pushbutton for prototypin g, as shown in figure 36 , left side. the reset signal may be sourced from v3p3sys (functional in mission mode only), v3p3d (mission and brownout modes), vbat (all modes, if battery is present), or from a comb ination of these sources, depending on the application. when the 71m6521be is used in an emi environment, the reset pin should be protected by the external components shown in figure 36 , right side. r 1 should be in the range of 100 and mounted as closely as possible to the ic. since the 71m6521be generates its own power-on reset, a reset button or circuitry, as shown in figure 36 , left side, is only required for test units and prototypes. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 66 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 r 1 reset 71m6521 dgnd 100 ? r 1 reset 71m6521 dgnd 100 ? r 1 reset 71m6521 dgnd v3p3d vbat/ v3p3d r 2 reset switch 1k ? 1nf 10k ? r 1 reset 71m6521 dgnd v3p3d vbat/ v3p3d r 2 reset switch 1k ? 1nf 10k ? figure 36: external components for the reset pi n: push-button (left), emi circuit (right) connecting the emulator port pins capacitors to ground must be used for pr otection from emi. production boards s hould have the ice_e pin connected to ground. if the ice pins are used to drive lcd segments, t he pull-up resistors should be omitted, as shown in figure 37 , and 22pf capacitors to gndd should be us ed for protection from emi. it is important to bring out the ice_e pin to the programming interface in order to create a way for reprogramming parts that have the flash secure bit (sfr 0xb2[6]) set. providing access to ice_e ensures that the part can be reset between erase and program cycles, which w ill enable programming devices to reprogram the part. the reset required is im- plemented with a watchdog timer reset (i.e. the hardware wdt must be enabled). lcd segments (optional) e_rst 71m6521b e_rxtx e_tclk 62 ? 62 ? 62 ? 22pf 22pf ice_e v3p3d e_rst lcd segments (optional) 71m6521b e_rxtx e_tclk 62 ? 62 ? 62 ? 22pf 22pf ice_e v3p3d figure 37: external component s for the emulator interface downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 67 of 97 crystal oscillator the oscillator of the 71m6521be drives a standard 32.768khz watch crystal. the osc illator has been designed specifically to handle these crystals and is compatible with their high impedance and limited power handling capability. the oscillator power dissipation is very low to maximize the lifetim e of any battery backup device attached to vbat. board layouts with minimum capacitance fr om xin to xout will require less battery current. good layouts will have xin and xout shielded from each other. since the oscillator is self-bi asing, an external resistor must not be connected across the crystal. with a typical 32khz crystal, the 71m6521be needs 600 to 650 m illiseconds to stabilize the oscillator clock after power-up. this time is added to the 125ms (4096 ck32 cycles) for the pll_o k signal to become true which is required for the part to enter mission mode. flash programming operational or test code can be programmed into the flash memory using ei ther an in-circuit em ulator or the flash programmer module (tfp-1) available from teridian. the flash programming procedure us es the e_rst, e_rxtx, and e_tclk pins. mpu firmware library all application-specific mpu f unctions mentioned above under application informa tion are available from teridian as a standard ansi c library and as ansi c s ource code. the code is available as part of the demonstration kit for the 71m6521be ic. the demonstration kits come with the 71m6521be ic preprogrammed with demo firmware mounted on a functional sample meter pcb (demo board). the demo boards a llow for quick and efficient evaluat ion of the ic without having to write firmware or having to suppl y an in-circuit emulator (ice). meter calibration once the teridian 71m6521be energy meter device has been inst alled in a meter system, it has to be calibrated for tolerances of the current s ensors, voltage dividers and signal conditioning com ponents. the device can be calibrated using the gain and phase adjustment factors accessible to the ce. the gai n adjustment is used to com pensate for tolerances of components used for signal conditioning, espec ially the resistive components. phase adj ustment is provided to compensate for phase shifts introduced by the current sensors. due to the flexibility of the mpu firmwar e, any calibration method, such as calib ration based on energy, or current and voltage can be implemented. it is also possible to implem ent segment-wise calibrati on (depending on current range). the 71m6521be supports common industry standard calibration techni ques, such as single-point (energy-only), multi-point (energy, vrms, irms), and auto-calibration. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 68 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 firmware interface i/o ram map C in numerical order not used bits are grayed out, contain no memory and are read by the mpu as zero. reserved bits may be in use and should not be changed. this table lis ts only the sfr registers that are not generic 8051 sfr registers. name addr bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 configuration: ce0 2000 equ[2:0] ce_e reserved ce1 2001 pre_samps[1:0] sum_cycles[5:0] ce2 2002 mux_div[1:0] chop_e[1:0] rtm_e wd_ovf reserved* ex_xfr comp0 2003 not used pll_ok not used reserved reserved reserved comp_stat[0] config0 2004 vref_cal pls_inv ckout_e[1:0] vref_dis mpu_div[2:0] config1 2005 reserved reserved eck_dis fir_len adc_e mux_alt flsh66z reserved version 2006 version[7:0] config2 2007 opt_txe[1:0] ex_pll ex_fwcol reserved opt_fdc[1:0] ce3 20a8 not used not used not used ce_lctn[4:0] wake 20a9 wake_arm sleep lcd_only not used wake_res wake_prd[2:0] tmux 20aa not used not used not used tmux[4:0] digital i/o: dio0 2008 dio_eex[1:0] opt_rxdis opt_rxinv dio_pw dio_pv opt_txmod opt_txinv dio1 2009 not used dio_r1[2:0] not used di_rpb[2:0] dio2 200a not used reserved not used dio_r2[2:0] dio3 200b not used dio_r5[2:0] not used dio_r4[2:0] dio4 200c not used dio_r7[2:0] not used dio_r6[2:0] dio5 200d not used dio_r9[2:0] not used dio_r8[2:0] dio6 200e not used dio_r11[2:0] not used dio_r10[2:0] we 201f reserved lcd display interface: lcdx 2020 not used bme reserved lcd_num[4:0] lcdy 2021 not used lcd_y lcd_e lcd_mode[2:0] lcd_clk[1:0] lcdz 2022 not used not used not used reserved lcd0 2030 not used lcd_seg0[3:0] not used lcd19 2043 not used lcd_seg19[3:0] lcd24 2048 not used lcd_seg24[3:0] not used lcd38 2056 not used lcd_seg38[3:0] lcd_blnk 205a lcd_blkmap19[3:0] lcd_blkmap18[3:0] * must be set to 0 (ce2 bit 1) downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 69 of 97 rtm probes: rtm0 2060 rtm0[7:0] rtm1 2061 rtm1[7:0] rtm2 2062 rtm2[7:0] rtm3 2063 rtm3[7:0] pulse generator: pls_w 2080 pls_maxwidth[7:0] pls_i 2081 pls_interval[7:0] sfr map (sfrs specific to teridian 80515) C in numerical order not used bits are blacked out and contain no memory and are read by the mpu as zero. reserved bits are in use and should not be changed. this table lis ts only the sfr registers that are not generic 8051 sfr registers name sfr bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 digital i/o: dio7 80 dio_0[7:4] (port 0) reserved dio_0[2:1] pb dio8 a2 dio_dir0[7:4] reserved dio_dir0[2:1] reserved dio9 90 dio_1[7:6] reserved dio_1[3:0] (port 1) dio10 91 dio_dir1[7:6] reserved dio_dir1[3:0] dio11 a0 not used not used reserved reserved dio_2[1:0] (port 2) dio12 a1 not used not used reserved reserved dio_dir2[1:0] interrupts and wd timer: intbits f8 int6 int5 int4 int3 int2 int1 int0 iflags e8 ie_pllfall wd_rst ie_pllrise ie_wake ie_pb ie_fwcol1 ie_fwcol0 reserved ie_xfer flash: erase 94 flsh_erase[7:0] flshctl b2 preboot secure not used not used not used not used flsh_meen flsh_pwe pgadr b7 flsh_pgadr[6:0] not used serial eeprom: eedata 9e eedata[7:0] eectrl 9f eectrl[7:0] downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 70 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 i/o ram description C alphabetical order bits with a w (write) direction are written by the mpu into c onfiguration ram. typically, they are initially stored in flash me mory and copied to the configuration ram by t he mpu. some of the more frequently pr ogrammed bits are mapped to the mpu sfr memory space. the remaining bits are mapped to 2xxx. bits with r (read) direction can be read by the mpu. columns labeled rst and wk describe the bit values upon reset and wake, respective ly. no entry in one of these columns means the bit is either read-only or is powered by the nonvol atile supply and is not initia lized. write only bits will return zero when they are read. name location rst wk dir description adc_e 2005[3] 0 0 r/w enables adc and vref. when disabled, removes bias current bme 2020[6] 0 - r/w battery measure enable. when set, a load current is immediately applied to the battery and it is c onnected to the adc to be measured on alternative mux cycles. see mux_alt bit. ce_e 2000[4] 0 0 r/w ce enable. ce_lctn[4:0] 20a8[4:0] 1f 1f r/w ce program location. the starti ng address for the ce program is 1024* ce_lctn . ce_lctn must be defined before the ce is started. chop_e[1:0] 2002[5:4] 0 0 r/w chop enable for the reference bandgap circuit. the value of chop will change on the rising edge of muxsync according to the value in chop_e : 00-toggle 1 01-positive 10-reversed 11-toggle 1 except at the mux sync edge at the end of sumcycle. ckout_e[1:0] 2004[5,4] 00 00 r/w cktest enable. the default is 00 00-seg19, 01-ck_fir (5mhz mission, 32khz brownout) 10-not allowed (reserved for production test) 11-same as 10. comp_stat[0] 2003[0] -- -- r the status of the power fail comparator for v1. di_rpb[2:0] dio_r1[2:0] dio_r2[2:0] dio_r4[2:0] dio_r5[2:0] dio_r6[2:0] dio_r7[2:0] dio_r8[2:0] dio_r9[2:0] dio_r10[2:0] dio_r11[2:0] 2009[2:0] 2009[6:4] 200a[2:0] 200b[2:0] 200b[6:4] 200c[2:0] 200c[6:4] 200d[2:0] 200d[6:4] 200e[2:0] 200e[6:4] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 r/w connects dedicated i/o pins dio2 and dio4 through dio11 as well as input pins pb and opt_rx/dio1 to internal resources. if more than one input is connected to the same resource, the multiple column below specifies how they are combined. dio_rx resource multiple 000 none -- 001 reserved or 010 t0 (timer0 clock or gate) or 011 t1 (timer1 clock or gate) or 100 high priority io interrupt (int0 rising) or 101 low priority io interrupt (int1 rising) or 110 high priority io interrupt (int0 falling) or 111 low priority io interrupt (int1 falling) or dio_dir0[7:4,2:1] sfra2 [7:4,2:0] 0 0 r/w programs the direction of pins dio7-dio4 and dio2-dio1. 1 indi- cates output. ignored if the pin is not configured as i/o. see dio_pv and dio_pw for special option for dio6 and dio7 outputs. see dio_eex for special option for dio4 and dio5. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 71 of 97 dio_dir1[7:6, 3:0] sfr91 [7:6,3:0] 0 0 r/w programs the direction of pins dio15-dio14, dio11-dio8. 1 indi- cates output. ignored if the pi n is not configured as i/o. dio_dir2 [5:3,2:1] sfra1 [5:3,2:1] 0 0 r/w programs the direction of pins dio17-dio16. 1 indicates output. ignored if the pin is not configured as i/o. dio_0[7:4,2:0] sfr80 [7:4,2:0] 0 0 r/w the value on the pins dio7-dio4 and dio2-dio1. pins configured as lcd will read zero. when wri tten, changes data on pins confi- gured as outputs. pins configured as lcd or input will ignore write operations. the pushbutton input pb is read on dio_0[0]. dio_1[7:6,3:0] sfr90 [7:6,3:0] 0 0 r/w the value on the pins dio15-d io14 and dio11-dio8. pins con- figured as lcd will read zero. when written, changes data on pins configured as outputs. pins configured as lcd or input will ignore write operations . dio_2[5:3,1:0] sfra0 [5:3,1:0] 0 0 r/w the value on the pins dio17-dio16. pins configured as lcd will read zero. when written, changes data on pins configured as out- puts. pins configured as lcd or input will ignore write operations. dio_eex[1:0] 2008[7:6] 0 0 r/w when set, converts dio4 and dio5 to interface with external eeprom. dio4 becomes sdck and dio5 becomes bi-directional sdata. lcd_num must be less than or equal to 18. dio_eex[1:0] function 00 disable eeprom interface 01 2-wire eeprom interface 10 3-wire eeprom interface 11 --not used-- dio_pw 2008[3] 0 0 r/w causes wpulse to be output on dio6, if dio6 is configured as output. lcd_num must be less than 16. eedata[7:0] sfr9e 0 0 r/w serial eeprom interface data eectrl[7:0] sfr9f 0 0 r/w serial eeprom interface control eck_dis 2005[5] 0 0 r/w emulator clo ck disable. when one, the em ulator clock is disabled. this bit is to be used with caution! inadvertently setting this bit will inhibit access to the part with the ice interface and thus preclude flash erase and pro- gramming operations . if eck_dis is set to zero, it should be done at least 1000ms after power-up to give emulators and programming devices enough time to complete an erase operation. equ[2:0] 2000[7:5] 0 0 r/w specif ies the power equation to be used by the ce. ex_xfr reserved ex_fwcol ex_pll 2002[0] 2001[1] 2007[4] 2007[5] 0 0 0 0 0 0 0 0 r/w interrupt enable bits. these bits enable the xfer_busy, the firmware collision, and pll interrupt s. note that if one of these interrupts is to be enabled, its corresponding 8051 ex enable must also be set. see the interrupts section for details. note that bit 2001[1] must always be 0. fir_len 2005[4] 0 0 r/w the lengt h of the adc decimat ion fir filter. 1-384 cycles, 0-288 cycles when fir_len =1, the adc has 2.370370x higher gain. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 72 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 flsh_erase[7:0] sfr94[7:0] 0 0 w flash erase initiate flsh_erase is used to initiate either the flash mass erase cycle or the flash page erase cycle. specific patterns are expected for flsh_erase in order to initiate the appropriate erase cycle. (default = 0x00). 0x55 C initiate flash page erase cycle. must be proceeded by a write to flsh_pgadr @ sfr 0xb7. 0xaa C initiate flash mass erase cycle. must be proceeded by a write to flsh_meen @ sfr 0xb2 and the debug (cc) port must be enabled. any other pattern written to flsh_erase will have no effect. flsh_meen sfrb2[1] 0 0 w mass erase enable 0 C mass erase disabled (default). 1 C mass erase enabled. must be re-written for each new mass erase cycle. flsh_pgadr[6:0] sfrb7[7:1] 0 0 w flash page erase address flsh_pgadr[6:0] C flash page address (page 0 thru 127) that will be erased during the page erase cycle. (default = 0x00). must be re-written for each new page erase cycle. flsh_pwe sfrb2[0] 0 0 r/w program write enable 0 C movx commands refer to xram space, normal operation (default). 1 C movx @dptr,a moves a to program space (flash) @ dptr. this bit is automatically reset after each byte written to flash. writes to this bit are inhibited when interrupts are enabled. fovride 20fd[4] 0 0 r/w permits the values written by mpu to temporarily override the values in the fuse register (reserved for production test). ie_fwcol0 ie_fwcol1 sfre8[2] sfre8[3] 0 0 0 0 r/w r/w interrupt flags for firmware collisi on interrupt. see flash memory section for details. ie_pb sfre8[4] 0 -- r/w pb flag. indicates that a rising edge occurred on pb. firmware must write a zero to this bit to clear it. the bit is also cleared when mpu requests sleep or lcd mode. on bootup, the mpu can read this bit to determine if the part was woken with the pb dio0[0]. ie_pllrise sfre8[6] 0 0 r/w indicates t hat the mpu was woken or inte rrupted (int 4) by system power becoming available, or more precisely, by pll_ok rising. firmware must write a zero to this bit to clear it ie_pllfall sfre8[7] 0 0 r/w indicate s that the mpu has entered brownout mode because system power has become unavailable (int 4), or more precisely, because pll_ok fell. note: this bit will not be set if the part wakes into brownout mode because of pb or the wake timer. firmware must write a zero to this bit to clear it. ie_xfer sfre8[0] 0 0 r/w interrupt flag. this flag moni tors the xfer_busy interrupt. the flags is set by hardware and must be cleared by the interrupt handler. note that ie6, the interr upt 6 flag bit in the 8051 must also be cleared when this interrupt occurs. ie_wake sfre8[5] 0 -- r/w indicates t hat the mpu was woken by the autowake timer. this bit is typically read by the mpu on boot up. firmware must write a zero to this bit to clear it downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 73 of 97 intbits sfrf8[6:0] -- -- r/w interrupt inputs. the mp u may read these bits to see the input to external interrupts int0, int1, up to int6. these bits do not have any memory and are primarily intended for debug use. lcd_blkmap19[3:0] lcd_blkmap18[3:0] 205a[7:4] 205a[3:0] 0 -- r/w identifies which segment s connected to seg18 and seg19 should blink. 1 means blink. most si gnificant bit corresponds to com3. least significant, to com0. lcd_clk[1:0] 2021[1:0] 0 -- r/w sets the lcd cl ock frequency (for com/seg pins, not frame rate). note: f w = 32768hz 00: f w /2 9 , 01: f w/ 2 8 , 10: f w /2 7 , 11: f w /2 6 lcd_e 2021[5] 0 -- r/w enables the lcd display. when disabled, vlc2, vlc1, and vlc0 are ground as are the com and seg outputs. lcd_mode[2:0] 2021[4:2] 0 -- r/w the lcd bias mode. 000: 4 states, 1/3 bias 001: 3 states, 1/3 bias 010: 2 states, ? bias 011: 3 states, ? bias 100: static display lcd_num[4:0] 2020[4:0] 0 -- r/w number of dual-purpose lcd/dio pins to be configured as lcd. this will be a number between 0 and 18. the first dual-purpose pin to be allocated as lcd is seg37/dio17 if lcd_num =5. if lcd_num =6, seg36 and seg 37 will be configured as lcd. the remaining seg35 to seg24 will be configured as dio16 to dio4. dio1 and dio2 are always available, if not used for the optical port. see tables in application section. lcd_only 20a9[5] 0 0 w takes the device to lcd mode. ignored if system power is present. the part will awaken when autowake timer times out, when push button is pushed, or when system power returns. lcd_seg0[3:0] lcd_seg19[3:0] 2030[3:0] 2043[3:0] 0 0 -- -- r/w lcd_seg24[3:0] lcd_seg38[3:0] 2048[3:0] 2056[3:0] 0 0 -- -- r/w lcd segment data. each word cont ains information for from 1 to 4 time divisions of each segment. in each word, bit 0 corresponds to com0, on up to bit 3 for com3. these bits are preserved in lcd and sleep modes, even if their pin is not configured as seg. in this case, they can be useful as general-purpose non-volatile storage. lcd_y 2021[6] 0 0 r/w lcd blink frequency (ignored if blink is di sabled or if segment is off). 0: 1hz (500ms on, 500ms off) 1: 0.5hz (1s on, 1s off) mpu_div[2:0] 2004[2:0] 0 0 r/w the mpu clock divider (from 4.9152mhz). these bits may be pro- grammed by the mpu without risk of losing control. 000-4.9152mhz, 001-4.9152mhz /2 1 , , 111-4.9152mhz /2 7 mpu_div remains unchanged when the part enters brownout mode. mux_alt 2005[2] 0 0 r/w the mpu asserts this bit when it wishes the mux to perform adc conversions on an alternate set of inputs. mux_div[1:0] 2002[7:6] 0 0 r/w the number of states in the input multiplexer. 00- illegal 01- 4 states 10-3 st ates 11-2 states downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 74 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 opt_fdc[1:0] 2007[1:0] 0 0 r/w selects op t_tx modulation duty cycle opt_fdc function 00 50% low 01 25% low 10 12.5% low 11 6.25% low opt_rxdis 2008[5] 0 0 r/w opt_rx can be configured as an analog input to the optical uart comparator or as a digital input/output, dio1. 0opt_rx, 1dio1. opt_rxinv 2008[4] 0 0 r/w inverts result from opt_rx comparator when 1. affects only the uart input. has no effect when op t_rx is used as a dio input. opt_txe[1,0] 2007[7,6] 00 00 r/w c onfigures the opt_tx output pin. 00opt_tx, 01dio2, 10wpulse, 11reserved opt_txinv 2008[0] 0 0 r/w invert opt_tx when 1. th is inversion occurs before modulation. opt_txmod 2008[1] 0 0 r/w enables modul ation of opt_tx. when opt_txmod is set, opt_tx is modulated when it would otherwise have been zero. the modulation is applied after any inversion caused by opt_txinv . pll_ok 2003[6] 0 0 r indicates that system power is present and the clock generation pll is settled. pls_maxwidth [7:0] 2080[7:0] ff ff r/w determines the maximum width of the pulse (low going pulse). maximum pulse width is (2*pls_maxwidth + 1)*t i . where t i is pls_interval. if pls_interval=0, t i is the sample time (397s). if 255, disable maxwidth . pls_interval [7:0] 2081[7:0] 0 0 r/w if the fifo is used, pls_interval must be set to 81. if pls_interval = 0, the fifo is not us ed and pulses are output as soon as the ce issues them. pls_inv 2004[6] 0 0 r/w inverts the pol arity of wpulse. normally, these pulses are active low. when inverted, they become active high. preboot sfrb2[7] -- -- r indicates t hat preboot sequence is active. pre_samps[1:0] 2001[7:6] 0 0 r/w the duration of the pre- summer, in samples. 00-42, 01-50, 10-84, 11-100. rtm_e 2002[3] 0 0 r/w real time monitor enable. w hen 0, the rtm output is low. this bit enables the two wire version of rtm rtm0[7:0] rtm1[7:0] rtm2[7:0] rtm3[7:0] 2060 2061 2062 2063 0 0 0 0 0 0 0 0 r/w four rtm probes. before each ce code pass, the values of these registers are serially output on the rtm pin. the rtm registers are ignored when rtm_e =0. secure sfrb2[6] 0 -- r/w enables security provisi ons that prevent exte rnal reading of flash memory and ce program ram. this bit is reset on chip reset and may only be set. attempts to write zero are ignored. sleep 20a9[6] 0 0 w takes the 6521be to sleep mode. ignored if system power is present. the 6521be will wake when the autowake timer times out, when push button is pushed, or when system power returns. sum_cycles[5:0] 2001[5:0] 0 0 r/w the number of pre-summer outputs summed in the final summer. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 75 of 97 tmux[4:0] 20aa[4:0] 2 -- r/w selects one of 32 signals for tmuxout. [4:0] selected signal [4:0] selected signal 0x00 dgnd (analog) 0x01 reserved 0x02 reserved 0x03 reserved 0x04 reserved 0x05 reserved 0x06 vbias (analog) 0x07 not used 0x08 reserved 0x09 reserved 0x0a reserved 0x0b -0x13 reserved 0x14 rtm (real time output from ce) 0x15 wdtr_e, comparator 1 output and v1lt3) 0x16 C 0x17 not used 0x18 rxd, from optical in- terface, after optional inversion 0x19 mux_sync 0x1a ck_10m 0x1b ck_mpu 0x1c reserved 0x1d reserved 0x1e ce_busy 0x1f xfer_busy version[7:0] 2006 -- -- r the version index. this word may be read by firmware to determine the silicon version. version[7:0] silicon version 0000 0110 a06 vref_cal 2004[7] 0 0 r/w brings vref to vref pad. this feature is disabled when vref_dis =1. vref_dis 2004[3] 0 1 r/w disables the in ternal voltage reference. wake_arm 20a9[7] 0 -- w arm the autowake timer. writ ing a 1 to this bit arms the autowake timer and presets it with the values presently in wake_prd and wake_res . the autowake timer is reset and disarmed whenever the processor is in mission mode or brownout mode. the timer must be armed at least three crystal clock cycles before the sleep or lcd-only mode is commanded. wake_prd 20a9[2:0] 001 -- r/w sleep time. time= wake_prd[2:0]*wake_res. default=001. maximum value is 7. wake_res 20a9[3] 0 -- r/w resolution of wake time r: 1 C 1 minute, 0 C 2.5 seconds. wd_rst sfre8[7] 0 0 w wd timer bit: possible operations to this bit are: read: gets the status of the flag ie_pllfall write 0: clears the flag write 1:.resets the wdt wd_ovf 2002[2] 0 0 r/w the wd overfl ow status bit. this bit is set when the wd timer overflows. it is powered by t he nonvolatile supply and at bootup will indicate if the part is recovering from a wd overflow or a power fault. this bit should be cleared by the mpu on bootup. it is also automatically cleared when reset is high. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 76 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 ce interface description ce program the ce program is supplied by teridi an as a data image that can be merged wi th the mpu operational code for meter applications. typically, the ce program co vers most applications and does not need to be modified. the description in this section applies to ce code revision ce6521be_a04. formats all ce words are 4 bytes. unless specified otherwise, they are in 32-bit twos complement (-1 = 0xffffffff). calibration parameters are defined in flash memory (or external eepro m) and must be copied to ce dat a memory by the mpu before enabling the ce. internal variables are used in internal ce calculations. input variables allow the mpu to control the beha vior of the ce code. output variables are outputs of the ce calculations. constants constants used in the ce data memory tables are: f s = 32768hz/13 = 2520.62hz. f 0 is the fundamental frequency. imax is the external rms current corresponding to 250mv pk at the inputs ia and ib. vmax is the external rms voltage correspondi ng to 250mv pk at the va and vb inputs. n acc , the accumulation count for energy measurements is pre_samps*sum_cycles . accumulation count time for energy measurements is pre_samps*sum_cycles /f s . the system constants imax and vmax are used to convert internal quantities (as used by the ce) to external, i.e. metering quantities. their values are determined by the off-chip scaling of the voltage and current sensors used in an actual meter. the lsb values used in this document relate di gital quantities at the ce interface to external meter input quantities. for example, if a sag threshold of 80v peak is desir ed at the meter input, the digital va lue that should be programmed into sag_thr would be 80v/ sag_thr lsb , where sag_thr lsb is the lsb value in the description of sag_thr . the parameters equ , ce_e , pre_samps, and sum_cycles essential to the function of the ce are stored in i/o ram (see i/o ram section). environment before starting the ce using the ce_e bit, the mpu has to establish the proper environment for the ce by implementing the following steps: load the ce data into ce dram. establish the equation to be applied in equ. establish the accumulation per iod and number of samples in pre_samps and sum_cycles . establish the number of cy cles per adc mux frame. set pls_interval [7:0] to 81. set fir_len to 1 and mux_div to 1. there must be thirteen 32768hz cycles per a dc mux frame (see system timing diagram, figure 16 ). this means that the product of the number of cycles per fr ame and the number of conver sions per frame must be 12 (allowing for one settling cycle). the required configuration is fir_len = 1 (three cycles per conversion) and mux_div = 1 (4 conversions per mux frame). during operation, the mpu is in charge of controlling the multiplexer cycles, for example by inserting an alternate multiplexer sequence at regular intervals using mux_alt . this enables temperature measurement. the polarity of chopping circuitry must be altered for each sample. it must also alternate for each alte rnate multiplexer reading. this is accomplished by maintaining chop_e = 00. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 77 of 97 ce calculations the ce performs the precision computations necessary to accurately meas ure energy. these comput ations include offset cancellation, products, product smoothing, product summation, frequency detection, and sag detection. all data computed by the ce is dependent on the select ed meter equation as given by equ ( in i/o ram ) . however, for the 6521be ce code, equ is always 0. element input mapping equ watt formula (wsum) w0sum w1sum i0sqsum i1sqsum 0 va ia (1 element, 2w 1 ) with tamper detection va*ia va*ib ia ib cestatus since the ce_busy interrupt occurs at 2520. 6hz, it is desirable to minimize the co mputation required in the interrupt handler of the mpu. the mpu can read the ce st atus word at every ce_busy interrupt. ce address name description 0x11e8 cestatus see description of ce status word below the ce status word is used for generati ng early warnings to the mpu. it contai ns sag warnings for va as well as the f0 bit, a clock derived from the f undamental input frequency. cestatus provides information about the status of voltage and input ac signal frequency, which are useful for gener ating early power fail warnings, e.g. to initiate necessary data storage. cestatus represents the status flags fo r the preceding ce code pass (ce busy interrupt ). sag alarms are not remembered from one code pass to the next. the ce status word is refreshed at every ce_busy interrupt. the significance of the bits in cestatus is shown in the table below: cestatus [bit] name description 31-29 not used these unused bits will always be zero. 28 f0 f0 is a square wave at the ex act fundamental input frequency. f0 mains signal f0 mains signal 27 creep normally zero. becomes one when creep logic has been applied to either wa or wb. 26 sag_b 25 sag_a normally zero. these bits come one when the voltage in the respective channel remains below sag_thr for sag_cnt samples. will not return to zero until the voltage rises above sag_thr . 24-0 not used these unused bits will always be zero. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 78 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 the ce is initialized by the mpu using ceconfig ( cestate ) . this register contains in pa cked form the control bits for sag_cnt, freqsel , neutral_tamper , ib_shunt , ia_shunt , pulse_slow , and pulse_fast . ce address name default description 0x1040 ceconfig 0x5000 see description of ceconfig below the significance of the bits in ceconfig is shown in the table below: ia_shunt and/or ib_shunt can configure their respective curr ent inputs to accept shunt resistor sensors. in this case the ce provides an additional gain of 8 to the selected current input. wrate may need to be adjusted based on the values of ia_ shunt and ib_ shunt . whenever ia_shunt or ib_shunt are set to 1, in_8 (in the equation for kh) is assigned a value of 8. the ce pulse generator is controlled only by the ce (internal) variables. note: the 6521be demo code creep function halts both internal and external pulse generation. ceconfig [bit] name default description [15:8] sag_cnt 80 (0x50) number of consecutive voltage samples below sag_thr before a sag alarm is declared. the maximum value is 255. sag_thr is at address 0x14. [7] -- 0 reserved [6] freqsel 0 selected phase for frequency monitor (0 = a, 1 = b). [5] neutral tamper 0 alert ce that neutral line tampering has been detected. [4] magnetic tamper 0 alert ce that magnetic tampering has been detected. [3] ib_shunt 0 when 1, the current gain of channel b is increased by 8. the gain factor controlled by in_shunt is referred to as in_8 throughout this document. [2] ia_shunt 0 when 1, the current gain of channel a is increased by 8. [1] pulse_fast 0 [0] pulse_slow 0 when pulse_slow = 1, the pulse generator input is reduced by a factor of 64. when pulse_fast = 1, the pulse generator input is increased 16x. these two parameters control the pulse gain factor x (see table below). allowed values are either 1 or 0. default is 0 (x = 6). x pulse_slow pulse_fast 1.5 * 2 2 = 6 0 0 1.5 * 2 6 = 96 0 1 1.5 * 2 -4 = 0.09375 1 0 1.5 1 1 downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 79 of 97 ce transfer variables when the mpu receives the xfer_busy interrupt, it knows that fresh data is availabl e in the transfer variables. fundamental energy measurement variables the table below describes each transfer variable for fundamental energy measurement. all variables are signed 32 bit integers. accumulated variables such as wsum are internally scaled so they have at least 2x margin before overflow when the integration time is 1 second. additi onally, the hardware will not permit output values to fold back upon overflow. ce address name description 0x11d8 w0sum_x 0x11c8 w1sum_x the sum of watt samples from each wattmeter element ( in_8 is the gain configured by ia_shunt or ib_shunt ). lsb = 6.6952*10 -13 vmax imax / in_8 wh. wxsum_x is the wh value accumulated for element x in the last accumulation interval and can be computed based on the specified lsb value. for example with vmax = 600v and imax = 208a, lsb (for wxsum_x ) is 0.08356 wh. instantaneous energy measurement variables the frequency measurement is co mputed using the frequency locked loop for the selected phase. ixsqsum_x and vxsqsum are the squared current and volt age samples acquired during the last accumulation interval. insqsum_x can be used for computing the neutral current. ce address name description 0x11e4 freq_x fundamental frequency. lsb 6 32 10 587 .0 2 ? ? s f hz 0x11f0 mainedge_x the number of zero crossings of the selected voltage in the previous ac- cumulation interval. zero crossings are either direction and are de- bounced. 0x11dc i0sqsum_x 0x11cc i1sqsum_x the sum of squared current samples from each element. lsb = 6.6952*10 -13 imax 2 / in_8 2 a 2 h 0x11e0 v0sqsum_x 0x11d0 v1sqsum_x the sum of squared voltage samples from each element. lsb= 6.6952*10 -13 vmax 2 v 2 h 0x11f4 wsum_accum rollover accumulator for wpulse. 0x11d4 i0sqrt_x 0x11c4 i1sqrt_x rms current determined by calc ulating the square root of i0sqsum_x and i1sqsum_x downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 80 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 other ce parameters temperature parameters mainedge_x is useful for implementing a real-t ime clock based on the input ac signal. mainedge_x is the number of half- cycles accounted for in the last accu mulated interval for the ac signal. temp_raw may be used by the mpu to monitor chip temperature. temperature compensation is implemented by the ce, based on the value written to temp_nom . ce address name default description 0x11ec temp_raw_x n/a filtered, unscaled reading from the temperature sensor. 0x105c temp_nom n/a reference temperature for temperature compensation. 0x1054 degscale 19065 multiplier for temperature calculation. 0x1048 gain_adj 16384 scales all voltage and current inputs, based on t he temperature compensation mechanism. 16384 provides unity gain. 0x1080 ppmc1 n/a linear parameter for te mperature compensation. 0x1084 ppmc2 n/a quadratic parameter for temperature compensation. gain_adj is a scaling factor for measur ements based on the temperature. gain_adj is controlled by the mpu for temperature compensation. sag, creep and tamper control ce address name default description 0x1070 creep0_thr 8311 0x1074 creep1_thr 8311 wh threshold for channels a and b. s acc f n vmax imax lsb ? ? ? = ? 13 10 6952 .6 the default value is equivalent to 2.5w 0x1050 sag_thr 443000 the threshold for sag warnings. the default value is equivalent to 80v rms if vmax = 600v. the lsb value is 1.80587*10 -4 v (rms). 0x1078 vnominal 1.27*10 8 nominal voltage to be applied to the la rger of the two currents when neutral tampering is detected. the default value is equivalent to 230v rms. 0x107c wnominal 7646227 nominal power consumption to be applied when magnetic tampering is detected. s acc f n vmax imax lsb ? ? ? = ? 13 10 6952 .6 the default value is equivalent to 0.65wh per accumulation interval, or 2300wh/h (230v, 10a). downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 81 of 97 pulse generation ce address name default description 0x1044 wrate 389 kh = vmax * imax *47.1132 / ( in_8 * wrate *n acc *x) wh/pulse. the default value results in a kh of 1.0wh/pulse when 2520 samples are taken in each accumulation interval (and vmax =600, imax = 208, in_8 = 1, x = 6). the maximum value for wrate is 2 15 C 1. wrate controls the number of pul ses that are generated per meas ured wh quantities. the lower wrate is the slower the pulse rate for measured energy quantity. t he metering constant kh is derived from wrate as the amount of energy measured for each pulse. that is, if kh = 1wh/pulse, a power applied to the meter of 120v and 30a results in one pulse per second. if the load is 240v at 150a, ten pulses per sec ond will be generated. x is controlled by the pulse_fast and pulse_slow bits in the ceconfig register. the maximum pulse rate is 7.5khz. the maximum time jitte r is 67s and is independent of t he number of pulses measured. thus, if the pulse generator is monitor ed for 1 second, the peak jitter is 67ppm. a fter 10 seconds, the peak jitter is 6.7ppm. the average jitter is always zero. if it is attempted to drive either pulse generator faster t han its maximum rate, it will sim ply output at its maximum rate without exhibiting any rollover characteristics. the actual pulse rate, using wsum as an example, is: hz x f wsum wrate rate s 46 2 ? ? ? = , where f s = sampling frequency (2520.6hz), x = pulse speed factor ce calibration parameters the table below lists the parameters that are typically entered to effe ct calibration of meter accuracy. ce address name default description 0x1020 cal_ia 16384 0x1024 cal_va 16384 0x1028 cal_ib 16384 0x102c cal_vb 16384 these constants control t he gain of their respective channels. the nominal value for each parameter is 2 14 = 16384. the gain of each channel is directly proportional to its cal parameter. thus, if the gain of a channel is 1% slow, cal should be scaled by 1/(1 C 0.01). 0x1030 phadj_a 0 0x1034 phadj_b 0 these two constants control the ct phase compensation. no compensation occurs when phadj_x = 0. as phadj_x is increased, more compensation (lag) is introduced. range: 2 15 C 1. if it is desired to delay the current by the angle : ? ? ? = tan tan x phadj 0131 .0 1487 .0 02229 .0 2 _ 20 at 60hz ? ? ? = ta n tan x phadj 009695 .0 1241 .0 0155 .0 2 _ 20 at 50hz downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 82 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 other ce parameters the table below shows ce parameter s used for suppression of noise due to scaling and truncation effects. ce address name default description 0x104c quanta 0 this parameter is added to the watt calc ulation for element 0 to compensate for input noise and truncation. lsb = ( vmax * imax / in_8 ) *7.4162*10 -10 w 0x1060 quantb 0 this parameter is added to the watt calc ulation for element 1 to compensate for input noise and truncation. lsb = ( vmax * imax / in_8 ) *7.4162*10 -10 w 0x1058 quant_ia 0 this parameter is added to compensate for input noise and truncation in the squaring calculations for i 2 . quant_ia affects only i0sqsum and i1sqsum . lsb = ( imax 2 /in_8 2 )*7.4162*10 -10 a 2 0x106c quant_ib 0 this parameter is added to compensate for input noise and truncation in the squaring calculations for i 2 . quant_ib affects only i0sqsum and i1sqsum . lsb = ( imax 2 /in_8 2 )*7.4162*10 -10 a 2 downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 83 of 97 electrical specifications absolute maximum ratings supplies and ground pins: v3p3sys, v3p3a ? 0.5v to 4.6v vbat -0.5v to 4.6v gndd -0.5v to +0.5v analog output pins: v3p3d -10ma to 10ma, -0.5v to 4.6v vref -10ma to +10ma, -0.5v to v3p3a+0.5v v2p5 -10ma to +10ma, -0.5v to 3.0v analog input pins: ia, va, ib, vb, v1 -10ma to +10ma -0.5v to v3p3a+0.5v xin, xout -10ma to +10ma -0.5v to 3.0v all other pins: configured as seg or com drivers -1ma to +1ma, -0.5 to v3p3d+0.5 configured as digital inputs -10ma to +10ma, -0.5 to 6v configured as digital outputs -15ma to +15ma, -0.5v to v3p3d+0.5v all other pins ? 0.5v to v3p3d+0.5v operating junction temper ature (peak, 100ms) 140 c operating junction temper ature (continuous) 125 c storage temperature ? 45 c to +165 c solder temperature C 10 second duration 250 c esd stress on all pins 4kv stresses beyond absolute maximum ratings may cause permanent dam age to the device. these are stress ratings only and functional operation at these or any other conditi ons beyond those indicated under recommended oper ating conditions is not implied. expo sure to absolute-maximum-rated conditions for ex tended periods may affect device reliability. all voltages are with respect to gnda. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 84 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 recommended external components name from to function value unit c1 v3p3a agnd bypass capacitor for 3.3v supply 0.1 20% f c2 v3p3d dgnd bypass capacitor for 3.3v output 0.1 20% f csys v3p3sys dgnd bypass capacitor for v3p3sys 1.0 30% f c2p5 v2p5 dgnd bypass capacitor for v2p5 0.1 20% f xtal xin xout 32.768khz crystal C electrically similar to ecs .327-12.5-17x or vishay xt26t, load capaci- tance 12.5pf 32.768 khz cxs ? xin agnd load capacitor for crystal (depends on crystal specs and board parasitics). 27 10% pf cxl ? xout agnd load capacitor for crystal (depends on crystal specs and board parasitics). 27 10% pf ? depending on trace capacitance, higher or lower values for cxs and cxl mu st be used. capacitanc e from xin to gndd and xout to gndd (combining pin, trace and crystal capacitance) should be 30pf to 42pf. recommended operating conditions parameter condition min typ max unit normal operation 3.0 3.3 3.6 v 3.3v supply voltage ( v3p3sys, v3p3a ) v3p3a and v3p3sys must be at the same voltage battery backup 0 3.6 v no battery externally connect to v3p3sys vbat battery backup brn and lcd modes sleep mode 3.0 2.0 3.8 3.8 v v operating temperature -40 +85 oc maximum input voltage on dio/seg pins configured as dio input. * mission mode brownout mode lcd mode v3p3sys+0.3 vbat+0.3 vbat+0.3 v v v *exceeding this limit will distort the lcd waveforms on other pins. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 85 of 97 performance specifications input logic levels parameter condition min typ max unit digital high-level input voltage ? , v ih 2 v digital low-level input voltage ? , v il 0.8 v exceptions to above input standard: input pull-up current, i il e_rxtx, e_rst, cktest other digital inputs vin=0v, ice_e=1 10 10 -1 0 100 100 1 a a a input pull down current, i ih ice_e pb other digital inputs vin=v3p3d 10 -1 -1 0 0 100 1 1 a a a ? in battery powered modes, digital inputs should be below 0.3v or above 2.5v to minimize battery current. output logic levels parameter condition min typ max unit i load = 1ma v3p3d C0.4 v digital high-level output voltage v oh i load = 15ma v3p3d- 0.6 v i load = 1ma 0 0.4 v digital low-level output voltage v ol i load = 15ma 0.8 v opt_tx v oh ( v3p3d - opt_tx ) i source =1ma 0.4 v opt_tx v ol i sink =20ma 0.7 v power-fault comparator parameter condition min typ max unit offset voltage v1-vbias -20 +15 mv hysteresis current v1 vin = vbias - 100mv 0.8 1.2 a response time v1 + 100mv overdrive 2 5 10 s wdt disable threshold ( v1 - v3p3a ) -400 -10 mv battery monitor bme=1 parameter condition min typ max unit load resistor 27 45 63 k ? lsb value - does not include the 9- bit left shift at ce input. fir_len =0 fir_len =1 -6.0 -2.6 -5.4 -2.3 -4.9 -2.0 v v offset error -200 -72 +100 mv downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 86 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 supply current parameter condition min typ max unit v3p3a + v3p3sys current 6.1 7.7 ma vbat current normal operation, v3p3a=v3p3sys =3.3v mpu_div = 3 (614khz), ckout_e = 0, ce_en = 1, rtm_e = 0, eck_dis = 1, adc_e = 1, ice_e = 0 -300 +300 na v3p3a + v3p3sys current vs. mpu clock frequency same conditions as above 0.5 ma/ mhz v3p3a + v3p3sys current, write flash normal operation as above, except write flash at maximum rate, ce_e=0, adc_e=0 9.1 10 ma vbat current vbat=3.6v brownout mode, <25c brownout mode, >25c lcd mode, 25c lcd mode, over temperature sleep mode, 25c sleep mode, over temperature 48 65 5.7 2.9 120 150 8.5 15 5.0 10 a a a a a a ? current into v3p3a and v3p3sys pins is not zero if voltage is applied at these pins in brownout, lcd or sleep modes. v3p3d switch parameter condition min typ max unit on resistance C v3p3sys to v3p3d | i v3p3d | 1ma 10 ? on resistance C vbat to v3p3d | i v3p3d | 1ma 40 ? 2.5v voltage regulator unless otherwise specified, load = 5ma parameter condition min typ max unit voltage overhead v3p3-v2p5 reduce v3p3 until v2p5 drops 200mv 440 mv pssr v2p5/ v3p3 reset=0, iload=0 -3 +3 mv/v downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 87 of 97 low power voltage regulator unless otherwise specified, v3p3sys=v3p3a =0, pb=gnd (brownout) parameter condition min typ max unit v2p5 i load =0 2.0 2.5 2.7 v v2p5 load regulation i load =0ma to 1ma 30 mv vbat voltage requirement i load =1ma, reduce vbat until reg_lp_ok=0 3.0 v psrr v2p5 / vbat i load =0 -50 50 mv/v crystal oscillator parameter condition min typ max unit maximum output power to crystal crystal connected 1 w xin to xout capacitance 3 pf capacitance to dgnd xin xout 5 5 pf pf vref, vbias unless otherwise specified, vref_dis =0 parameter condition min typ max unit vref output voltage, vnom(25) ta = 22oc 1.193 1.195 1.197 v vref chop step 50 mv vref output impedance vref_cal =1, i load = 10a, -10a 2.5 k ? vnom definition a 2 )22 (1 )22 ()22( )( 2 tc t tc t vref t vnom ? + ? + = v vref temperature coefficients tc1 tc2 +7.0 -0.341 v/oc v/c 2 vref aging 25 ppm/year vref(t) deviation from vnom(t) 62 10 )( )( 6 vnom t vnom t vref ? ta = -40oc to +85oc -40 +40 ppm/oc vbias voltage ta = 25oc ta = -40oc to 85oc (-1%) (-4%) 1.6 1.6 (+1%) (+4%) v v a this relationship describes the nominal behav ior of vref at different temperatures. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 88 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 lcd drivers applies to all com and seg pins. parameter condition min typ max unit vlc2 max voltage with respect to vlcd -0.1 0+.1 v vlc1 voltage, 1/3 bias ? bias with respect to 2*vlc2/3 with respect to vlc2/2 -4 -3 0 +2 % % vlc0 voltage, 1/3 bias ? bias with respect to vlc2/3 with respect to vlc2/2 -3 -3 +2 +2 % % vlcd is v3p3sys in mission mode and vbat in brownout and lcd modes. adc converter, v3p3a referenced fir_len =0, vref_dis =0, lsb values do not include the 9-bit left shift at ce input. parameter condition min typ max unit recommended input range (vin- v3p3a ) -250 250 mv peak voltage to current crosstalk: ) cos( * 10 6 vcrosstalk vin vin vcrosstalk ? vin = 200mv peak, 65hz, on va vcrosstalk = largest measurement on ia or ib -10 10 v/v thd (first 10 harmonics) 250mv-pk 20mv-pk vin=65hz, 64kpts fft, blackman- harris window -75 -90 db db input impedance vin=65hz 40 90 k ? temperature coefficient of input impedance vin=65hz 1.7 ? /c lsb size fir_len =0 fir_len =1 357 151 nv/lsb digital full scale fir_len =0 fir_len =1 + 884736 2097152 lsb adc gain error vs %power supply variation 3.3/33 100 / 357 10 6 a p v v nv nout in pk vin=200mv pk, 65hz v3p3a=3.0v, 3.6v 50 ppm/% input offset (vin- v3p3a ) -10 10 mv optical interface parameter condition min typ max unit opt_tx v oh ( v3p3d - opt_tx ) i source =1ma 0.4 v opt_tx v ol i sink =20ma 0.7 v downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 89 of 97 temperature sensor lsb values do not include the 9-bit left shift at ce input. parameter condition min typ max unit nominal sensitivity (s n ) 4 fir_len =1 -2180 lsb/oc nominal sensitivity (s n ) 4 fir_len =0 -923 lsb/oc nominal (n n ) 4, fir_len =1 1.0 10 6 lsb nominal (n n ) 4, fir_len =0 t n =25oc nominal relationship: n(t)= s n *(t-t n )+n n 0.4 10 6 lsb temperature error ?? ? ?? ? ? ?? ? + ? ? = n n n t s n tn t err ) )(( t = -40oc to +85oc, t n = 25c -10 +10 oc ?? n n is measured at t n during meter calibration and is stored in mpu or ce for use in temperature calculations. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 90 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 timing specifications ram and flash memory parameter condition min typ max unit ckmpu = 4.9mhz 5 cycles ckmpu = 1.25mhz 2 cycles ce dram wait states ckmpu = 614khz 1 cycles flash read pulse width v3p3a=v3p3sys=0 brownout mode 30 100 ns flash write cycles -40c to +85c 20,000 cycles flash data retention 25c 100 years flash data retention 85c 10 years flash byte writes between page or mass erase operations 2 cycles flash memory timing parameter condition min typ max unit write time per byte 42 s page erase (512 bytes) 20 ms mass erase 200 ms eeprom interface parameter condition min typ max unit ckmpu=4.9mhz, using interrupts 78 khz write clock frequency ( i 2 c ) ckmpu=4.9mhz, bit-banging dio4/5 150 khz write clock frequency (3-wire) ckmpu=4.9mhz 500 khz reset parameter condition min typ max unit reset pulse width 5 s reset pulse fall time 1 s footnotes 1 this spec is guaranteed, has been verified in producti on samples, but is not measured in production. 2 this spec is guaranteed, has been verified in production samples, but is measured in production only at dc. 3 this spec is measured in production at the lim its of the specified operating temperature. 4 this spec defines a nominal relationshi p rather than a measured par ameter. correct circuit operation is verified with other specs that use this nominal relationship as a reference. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 91 of 97 typical performance data -0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5 0.1 1 10 100 1000 current [a] error [%] phase_0 phase_60 phase_300 figure 38: wh accuracy, 0.1a to 200a at 240v/50hz and room temperature -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 135791 11 31 51 71 92 12 32 5 harmonic error [% ] 50hz harmonic data 60hz harmonic data measured at current distortion amplitude of 40% and voltage distortion amplitude of 10%. figure 39: meter accuracy over harmonics at 240v, 30a downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 92 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 relative accuracy over temperature -30 -20 -10 0 10 20 30 40 -60 -40 -20 0 20 40 60 80 100 temperature [c] accuracy [ppm/c] figure 40: typical meter accuracy over temperature relative to 25c package outline (lqfp 64) 11.7 12.3 0.60 typ. 1.40 1.60 11.7 12.3 0.00 0.20 9.8 10.2 0.50 typ. 0.14 0.28 pin no. 1 indicator + controlling dimensions are in mm downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 93 of 97 pinout (lqfp-64) teridian 71m6521be-igt gndd e_rxtx/seg38 opt_tx/dio2 tmuxout tx seg3 v3p3d cktest/seg19 v3p3sys seg4 seg5 seg37/dio17 com1 com0 com2 33 64 reset v2p5 vbat rx seg31/dio11 seg30/dio10 seg29/dio9 seg28/dio8 seg27/dio7 seg26/dio6 seg25/dio5 ice_e seg24/dio4 seg18 seg17 seg16 com3 seg0 seg35/dio15 seg36/dio16 seg6 seg8 seg1 seg2 seg34/dio14 seg7 seg12 seg10 seg11 seg9 seg15 seg13 seg14 e_tclk/seg33 va opt_rx/dio1 test gnda v3p3a e_rst/seg32 pb xout v1 xin x4mhz ia vb vref 1 17 23 4 5 67 8 9 1011 12 13 14 1516 1819 2021 22 24 2325 26 27 28 29 30 31 32 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 6362 61 6059 58 57 56 55 54 53 52 51 50 49 ib \ downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 94 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 pin descriptions power/ground pins: name type circuit description gnda p -- analog ground: this pin should be connected directly to the ground plane. gndd p -- digital ground: this pin should be connected directly to the ground plane. v3p3a p -- analog power supply: a 3.3v power supply should be connected to this pin, must be the same voltage as v3p3sys. v3p3sys p -- system 3.3v supply. this pin should be connected to a 3.3v power supply. v3p3d o 13 auxiliary voltage output of the ch ip, controlled by the internal 3.3v selection switch. in mission mode, this pin is internally connect ed to v3p3sys. in brownout mode, it is internally connected to vbat. this pin is floating in lcd and sleep mode. vbat p 12 battery backup power supply. a battery or super-capacitor is to be connected between vbat and gndd. if no battery is used, connect vbat to v3p3sys. v2p5 o 10 output of the internal 2.5v regulator. a 0.1f capacitor to gnda should be connected to this pin. analog pins: name type circuit description ia, ib i 6 line current sense inputs: these pins are voltage inputs to t he internal a/d converter. typically, they are connected to the outputs of cu rrent sensors. unused pins must be connected to v3p3a. va, vb i 6 line voltage sense inputs: these pins are voltage inputs to t he internal a/d converter. typically, they are connected to t he outputs of resistor dividers. unused pins must be connected to v3p3a or tied to the voltage sense input that is in use. v1 i 7 comparator input: this pin is a voltage input to the internal comparator. the voltage ap- plied to the pin is compared to an internal bias voltage (1.6v). if the input voltage is above the reference, the compar ator output will be high (1). if the comparator output is low, a voltage fault will occur. a 0.1f capacitor to gnda should be connected to this pin. vref o 9 voltage reference for the adc. this pi n is normally disabled by setting the vref_cal bit in the i/o ram and can be left unconnected. if enabled, a 0.1f capacitor to gnda should be connected. xin xout i 8 crystal inputs: a 32khz crystal should be c onnected across these pins. typically, a 27pf capacitor is also connected from each pin to gnda. it is important to minimize the capacitance between these pins . see the crystal manufactu rer datasheet for details. pin types: p = power, o = out put, i = input, i/o = input/output the circuit number denotes the equivalent circuit, as specified under i/o equivalent circuits. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 95 of 97 digital pins: name type circuit description com3, com2, com1, com0 o 5 lcd common outputs: these 4 pins provi de the select signals for the lcd display. seg0seg18 o 5 dedicated lcd segment output. seg24/dio4 seg31/dio11 i/o 3, 4, 5 multi-use pins, configurable as either lcd seg driver or dio. (dio4 = sck, dio5 = sda when configured as eeprom interface, wpulse = dio6 when configured as pulse outputs). if unused, these pins must be configured as outputs. seg34/dio14 seg37/dio17 i/o 3, 4, 5 multi-use pins, configurable as either lcd seg driver or dio. if unused, these pins must be configured as outputs. e_rxtx/seg38 i/o 1, 4, 5 e_rst/seg32 i/o 1, 4, 5 e_tclk/seg33 o 4, 5 multi-use pins, configurable as either emulator port pins (when ice_e pulled high) or lcd seg drivers (when ice_e tied to gnd). ice_e i 2 ice enable. when zero, e_rst, e_tclk, and e_rxtx become seg32, seg33, and seg38 respectively. for production units, this pin should be pulled to gnd to disable the emulator port. this pin should be brought out to the programming inter- face in order to create a way fo r reprogramming parts that have the secure bit set. cktest/seg19 o 4, 5 multi-use pin, configurable as either clock pll output or lcd segment driver. can be enabled and disabled by ckout_en . tmuxout o 4 digital output test mult iplexer. controlled by tmux [4:0]. opt_rx/dio1 i/o 3, 4, 7 multi-use pin, configurable as either optical receive input or general dio. when configured as opt_rx, this pin receives a signal from an external photo-detector used in an ir serial interface. if unused, this pin must be configured as an output or terminated to v3p3d or gndd. opt_tx/dio2 i/o 3, 4 multi-use pin, configurabl e as either optical led transmit output, wpulse, rpulse, or general dio. when configured as opt_tx, this pin is capable of directly driving an led for transmitti ng data in an ir serial interface. if unused, this pin must be configured as an output or terminated to v3p3d or gndd. reset i 3 this input pin resets the chip into a know n state. for normal operation, this pin is connected to gndd. to reset the chip, this pin should be pulled high. no external reset circuitry is necessary. rx i 3 uart input. if unused, this pin must be terminated to v3p3d or gndd. tx o 4 uart output. test i 7 enables production test. must be grounded in normal operation. pb i 3 push button input. a rising edge sets the ie_pb flag and causes the part to wake up if it is in sleep or lcd mode. pb does not have an internal pull-up or pull-down. if unused, this pin must be terminated to gndd. x4mhz i 3 this pin must be connected to gndd. pin types: p = power, o = out put, i = input, i/o = input/output the circuit number denotes the equivalent circuit, as specified on the following page. downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 page: 96 of 97 ? 2005-2008 teridian semiconductor corporation v1.0 i/o equivalent circuits: digital input equivalent circuit type 1: standard digital input or pin configured as dio input with internal pull-up gndd 110k v3p3d cmos input v3p3d digital input pin cmos output gndd v3p3d gndd v3p3d digital output equivalent circuit type 4: standard digital output or pin configured as dio output digital output pin lcd output equivalent circuit type 5: lcd seg or pin configured as lcd seg lcd driver gndd lcd seg output pin to mux gnda v3p3a analog input equivalent circuit type 6 : adc input analog input pin comparator input equivalent circuit type 7: comparator input gnda v3p3a to comparator comparator input pin vref equivalent circuit type 9: vref from internal reference gnda v3p3a vref pin v2p5 equivalent circuit type 10: v2p5 from internal reference gndd v3p3d v2p5 pin vbat equivalent circuit type 12: vbat power gndd power down circuits vbat pin v3p3d equivalent circuit type 13: v3p3d from v3p3sys v3p3d pin from vbat 1040 oscillator equivalent circuit type 8: oscillator i/o to oscillator gndd oscillator pin digital input type 2: pin configured as dio input with internal pull-down gndd 110k gndd cmos input v3p3d digital input pin digital input type 3: standard digital input or pin configured as dio input gndd cmos input v3p3d digital input pin downloaded from: http:///
71m6521be energy meter ic data sheet january 2008 v1.0 ? 2005-2008 teridian semiconductor corporation page: 97 of 97 ordering information part part description (package, accuracy) flash memory size packaging ordering number package marking 71m6521be 64-pin lqfp, lead free, 0.5% 8kb bulk 71m6521be-igt/f 71m6521be-igt 71m6521be 64-pin lqfp, lead free, 0.5% 8kb tape & reel 71m6521be- igtr/f 71m6521be-igt data sheet: this data sheet is proprietary to teridian semiconductor corporation (tsc) and sets forth design goals for the described product. this data sheet is subject to c hange. tsc assumes no obligation regarding future manufacture, unless agreed to in writ ing. if and when manufactured and sold, this product is so ld subject to the terms and conditions of sale supplied at the time of order ackn owledgment, including those pertaining to warranty, patent infringement and lim itation of liability. teridian semiconductor corporation (ts c) reserves the right to make changes in specifications at any time without notice. accordingly, the reader is cautioned to verify that a d ata sheet is current before placing orders. tsc assume s no liability for applications assistance. teridian semiconductor corp., 6440 oak canyon, suite 100, irvine, ca 92618 tel (714) 508-8800, fax (714) 508-8877, http ://www.teridian.com ? 2005-2008 ? teridian semiconductor corporation 1/28/2008 downloaded from: http:///


▲Up To Search▲   

 
Price & Availability of 71M6521BE-IGTF

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X